Haskell环境泄露后重新安装 [英] Haskell environment hosed post reinstall

查看:108
本文介绍了Haskell环境泄露后重新安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近重新安装了我的Haskell环境,因为我认为在将我的Mac OS X升级到Mavericks后,它已经超越了恢复。



现在每次运行 cabal install cabal-install ,我得到以下错误。

 解决依赖关系... 
配置cabal-install-1.18.0.3 ...

/var/folders/4l/qbdvy5xj4q53skv0zn0lhw940000gp/T/8247.c:1:12:
warning:控制到达非void函数的结尾[-Wreturn-type]
int foo(){ }
^
1生成警告。
构建cabal-install-1.18.0.3 ...
为cabal-install-1.18.0.3预处理可执行文件'cabal'...

Main.hs:118:8 :
无法找到模块`Distribution.Version'
'Cabal-1.18.1.3'包中缺少文件,
尝试运行'ghc-pkg check'。
使用-v查看搜索的文件列表。
未能安装cabal-install-1.18.0.3
cabal:错误:某些软件包未能安装:
cabal-install-1.18.0.3在构建阶段失败。例外情况是:
ExitFailure 1
Abes-MacBook-Pro:artifact abe $ cabal install cabal-install
解决依赖关系...
配置cabal-install-1.18.0.3。 ..

/var/folders/4l/qbdvy5xj4q53skv0zn0lhw940000gp/T/8335.c:1:12:
警告:控制到达非void函数的结束[-Wreturn-type]
int foo(){}
^
1生成警告。
构建cabal-install-1.18.0.3 ...
为cabal-install-1.18.0.3预处理可执行文件'cabal'...

Main.hs:118:8 :
无法找到模块`Distribution.Version'
'Cabal-1.18.1.3'包中缺少文件,
尝试运行'ghc-pkg check'。
使用-v查看搜索的文件列表。
未能安装cabal-install-1.18.0.3
cabal:错误:某些软件包未能安装:
cabal-install-1.18.0.3在构建阶段失败。例外情况是:
ExitFailure 1

在Google搜寻后,我发现这个:< a href =http://www.haskell.org/platform/ghc-clang-wrapper =nofollow> http://www.haskell.org/platform/ghc-clang-wrapper



运行时为Haskell打包,但上述错误仍然存​​在。



运行 ghc-pkg check

 软件包Cabal-1.18.1.3存在问题:
警告:library-dirs:/Users/abe/Library/Haskell/ghc-7.6.3/lib/Cabal-1.18.1.3/lib不存在或不是目录
警告:haddock- interfaces:/Users/abe/Library/Haskell/ghc-7.6.3/lib/Cabal-1.18.1.3/doc/html/Cabal.haddock不存在或不是文件
警告:haddock- html:/Users/abe/Library/Haskell/ghc-7.6.3/lib/Cabal-1.18.1.3/doc/html不存在或不是目录
import-dirs:/ Users / abe /Library/Haskell/ghc-7.6.3/lib/Cabal-1.18.1.3/lib不存在或不是目录
文件Distribution / Compat / Environment.hi丢失
文件Distribution / Compat / Exception.hi丢失
文件Distribution / Compat / ReadP.hi丢失
文件Distribution / Compiler.hi丢失
文件Distribution / InstalledPackageInfo.hi缺少
文件Distribution / License.hi缺少
文件Distribution / Make.hi缺少
文件Distribution / ModuleName.hi缺少
文件Distribution / Package.hi缺少
文件Distribution / PackageDescription.hi缺少
文件Distribution / PackageDescription / Check.hi缺少
文件Distribution / PackageDescription / Configuration.hi缺失
文件Distribution / PackageDescription / Parse.hi缺少
文件Distribution / PackageDescription / PrettyPrint.hi缺少
文件Distribution / PackageDescription / Utils.hi缺少
文件Distribution / ParseUtils .hi缺少
文件Distribution / ReadE.hi缺少
文件Distribution / Simple.hi缺少
fil e Distribution / Simple / Bench.hi缺少
文件Distribution / Simple / Build.hi缺少
文件Distribution / Simple / Build / Macros.hi缺少
文件Distribution / Simple / Build /PathsModule.hi缺少
文件Distribution / Simple / BuildPaths.hi缺少
文件Distribution / Simple / BuildTarget.hi缺少
文件Distribution / Simple / CCompiler.hi缺少
文件Distribution / Simple / Command.hi缺少
文件Distribution / Simple / Compiler.hi缺少
文件Distribution / Simple / Configure.hi缺少
文件Distribution / Simple / GHC .hi缺少
文件Distribution / Simple / Haddock.hi缺少
文件Distribution / Simple / Hpc.hi缺少
文件Distribution / Simple / Hugs.hi缺少
文件Distribution / Simple / Install.hi缺少
文件Distribution / Simple / InstallDirs.hi缺少
文件Distribution / Simple / JHC.hi缺少
文件Distribution / Simple / LHC.hi缺少
文件Distribution / Simpl e / LocalBuildInfo.hi缺少
文件Distribution / Simple / NHC.hi缺少
文件Distribution / Simple / PackageIndex.hi缺少
文件Distribution / Simple / PreProcess.hi缺失
文件Distribution / Simple / PreProcess / Unlit.hi缺少
文件Distribution / Simple / Program.hi缺少
文件Distribution / Simple / Program / Ar.hi缺少
文件Distribution / Simple / Program / Builtin.hi缺少
文件Distribution / Simple / Program / Db.hi缺少
文件Distribution / Simple / Program / Find.hi缺少
文件分发/ Simple / Program / GHC.hi缺少
文件Distribution / Simple / Program / HcPkg.hi缺少
文件Distribution / Simple / Program / Hpc.hi缺少
文件Distribution / Simple / Program / Ld.hi缺少
文件Distribution / Simple / Program / Run.hi缺少
文件Distribution / Simple / Program / Script.hi缺少
文件Distribution / Simple / Program / Types.hi缺少
文件分发/简单/注册r.hi缺少
文件Distribution / Simple / Setup.hi缺少
文件Distribution / Simple / SrcDist.hi缺少
文件Distribution / Simple / Test.hi缺少
文件Distribution / Simple / UHC.hi缺少
文件Distribution / Simple / UserHooks.hi缺少
文件Distribution / Simple / Utils.hi缺少
文件Distribution / System.hi is缺少
文件Distribution / TestSuite.hi缺少
文件Distribution / Text.hi缺少
文件Distribution / Verbosity.hi缺少
文件Distribution / Version.hi缺少
文件语言/ Haskell / Extension.hi缺少
文件Distribution / Compat / CopyFile.hi缺少
文件Distribution / Compat / TempFile.hi缺少
文件Distribution / GetOpt。 hi缺少
文件Distribution / Simple / GHC / IPI641.hi缺少
文件Distribution / Simple / GHC / IPI642.hi缺少
文件Paths_Cabal.hi缺失
无法在库路径
上找到libHSCabal-1.18.1.3.a警告:ha ddock-interfaces:/Library/Haskell/ghc-7.6.3/lib/haskell-platform-2013.2.0.0/doc/html/haskell-platform.haddock不存在或不是文件
警告: haddock-html:/Library/Haskell/ghc-7.6.3/lib/haskell-platform-2013.2.0.0/doc/html不存在或不是目录

以下包是或者因为他们有上面列出的问题
,或者因为他们依赖于破损的包裹。
Cabal-1.18.1.3

为什么我的Haskell环境非常糟糕?我该如何解决它?

解决方案

一种方法是删除您的本地 ghc code $> $ cd $ / $&$;&&& amp;& amp;& rm -rf * / package.conf.d
$ ghc-pkg --user recache

执行此操作后,请再次尝试使用 cabal 命令。 $ b

  $ cabal install package-name 

>。如果不是,请尝试删除您的 cabal 包,然后重复上述步骤: $ b

  $ rm -rf〜/ .cabal 

如果您仍然遇到问题,缺少的软件包可能会被系统ghc软件包缓存引用。运行这个命令:
$ b

  $ ghc-pkg --user recache 
$ sudo ghc -pkg recache
$ ghc-pkg -v check

最后一个命令应该打印系统缓存。在我的GNU / Linux系统上,它打印出以下内容:

 使用cache:/home/sudoman/.ghc/x86_64-linux- 7.6.3 / package.conf.d / package.cache 
使用缓存:/var/lib/ghc/package.conf.d/package.cache

此时,我没有基于经验的解决方案,但是您可能需要考虑删除上述的ghc系统包缓存,然后执行重新缓存;或重新安装ghc / haskell-platform。


I've recently reinstalled my Haskell environment as I thought I had hosed it beyond recovery after updating my Mac OS X to Mavericks.

Now every time I run cabal install cabal-install, I get the following error.

Resolving dependencies...
Configuring cabal-install-1.18.0.3...

/var/folders/4l/qbdvy5xj4q53skv0zn0lhw940000gp/T/8247.c:1:12:
     warning: control reaches end of non-void function [-Wreturn-type]
int foo() {}
           ^
1 warning generated.
Building cabal-install-1.18.0.3...
Preprocessing executable 'cabal' for cabal-install-1.18.0.3...

Main.hs:118:8:
    Could not find module `Distribution.Version'
    There are files missing in the `Cabal-1.18.1.3' package,
    try running 'ghc-pkg check'.
    Use -v to see a list of the files searched for.
Failed to install cabal-install-1.18.0.3
cabal: Error: some packages failed to install:
cabal-install-1.18.0.3 failed during the building phase. The exception was:
ExitFailure 1
Abes-MacBook-Pro:artifact abe$ cabal install cabal-install
Resolving dependencies...
Configuring cabal-install-1.18.0.3...

/var/folders/4l/qbdvy5xj4q53skv0zn0lhw940000gp/T/8335.c:1:12:
     warning: control reaches end of non-void function [-Wreturn-type]
int foo() {}
           ^
1 warning generated.
Building cabal-install-1.18.0.3...
Preprocessing executable 'cabal' for cabal-install-1.18.0.3...

Main.hs:118:8:
    Could not find module `Distribution.Version'
    There are files missing in the `Cabal-1.18.1.3' package,
    try running 'ghc-pkg check'.
    Use -v to see a list of the files searched for.
Failed to install cabal-install-1.18.0.3
cabal: Error: some packages failed to install:
cabal-install-1.18.0.3 failed during the building phase. The exception was:
ExitFailure 1

After googling around, I've found this: http://www.haskell.org/platform/ghc-clang-wrapper

Which I ran to wrap clang for Haskell, however the above error still occurs.

running ghc-pkg check

There are problems in package Cabal-1.18.1.3:
  Warning: library-dirs: /Users/abe/Library/Haskell/ghc-7.6.3/lib/Cabal-1.18.1.3/lib doesn't exist or isn't a directory
  Warning: haddock-interfaces: /Users/abe/Library/Haskell/ghc-7.6.3/lib/Cabal-1.18.1.3/doc/html/Cabal.haddock doesn't exist or isn't a file
  Warning: haddock-html: /Users/abe/Library/Haskell/ghc-7.6.3/lib/Cabal-1.18.1.3/doc/html doesn't exist or isn't a directory
  import-dirs: /Users/abe/Library/Haskell/ghc-7.6.3/lib/Cabal-1.18.1.3/lib doesn't exist or isn't a directory
  file Distribution/Compat/Environment.hi is missing
  file Distribution/Compat/Exception.hi is missing
  file Distribution/Compat/ReadP.hi is missing
  file Distribution/Compiler.hi is missing
  file Distribution/InstalledPackageInfo.hi is missing
  file Distribution/License.hi is missing
  file Distribution/Make.hi is missing
  file Distribution/ModuleName.hi is missing
  file Distribution/Package.hi is missing
  file Distribution/PackageDescription.hi is missing
  file Distribution/PackageDescription/Check.hi is missing
  file Distribution/PackageDescription/Configuration.hi is missing
  file Distribution/PackageDescription/Parse.hi is missing
  file Distribution/PackageDescription/PrettyPrint.hi is missing
  file Distribution/PackageDescription/Utils.hi is missing
  file Distribution/ParseUtils.hi is missing
  file Distribution/ReadE.hi is missing
  file Distribution/Simple.hi is missing
  file Distribution/Simple/Bench.hi is missing
  file Distribution/Simple/Build.hi is missing
  file Distribution/Simple/Build/Macros.hi is missing
  file Distribution/Simple/Build/PathsModule.hi is missing
  file Distribution/Simple/BuildPaths.hi is missing
  file Distribution/Simple/BuildTarget.hi is missing
  file Distribution/Simple/CCompiler.hi is missing
  file Distribution/Simple/Command.hi is missing
  file Distribution/Simple/Compiler.hi is missing
  file Distribution/Simple/Configure.hi is missing
  file Distribution/Simple/GHC.hi is missing
  file Distribution/Simple/Haddock.hi is missing
  file Distribution/Simple/Hpc.hi is missing
  file Distribution/Simple/Hugs.hi is missing
  file Distribution/Simple/Install.hi is missing
  file Distribution/Simple/InstallDirs.hi is missing
  file Distribution/Simple/JHC.hi is missing
  file Distribution/Simple/LHC.hi is missing
  file Distribution/Simple/LocalBuildInfo.hi is missing
  file Distribution/Simple/NHC.hi is missing
  file Distribution/Simple/PackageIndex.hi is missing
  file Distribution/Simple/PreProcess.hi is missing
  file Distribution/Simple/PreProcess/Unlit.hi is missing
  file Distribution/Simple/Program.hi is missing
  file Distribution/Simple/Program/Ar.hi is missing
  file Distribution/Simple/Program/Builtin.hi is missing
  file Distribution/Simple/Program/Db.hi is missing
  file Distribution/Simple/Program/Find.hi is missing
  file Distribution/Simple/Program/GHC.hi is missing
  file Distribution/Simple/Program/HcPkg.hi is missing
  file Distribution/Simple/Program/Hpc.hi is missing
  file Distribution/Simple/Program/Ld.hi is missing
  file Distribution/Simple/Program/Run.hi is missing
  file Distribution/Simple/Program/Script.hi is missing
  file Distribution/Simple/Program/Types.hi is missing
  file Distribution/Simple/Register.hi is missing
  file Distribution/Simple/Setup.hi is missing
  file Distribution/Simple/SrcDist.hi is missing
  file Distribution/Simple/Test.hi is missing
  file Distribution/Simple/UHC.hi is missing
  file Distribution/Simple/UserHooks.hi is missing
  file Distribution/Simple/Utils.hi is missing
  file Distribution/System.hi is missing
  file Distribution/TestSuite.hi is missing
  file Distribution/Text.hi is missing
  file Distribution/Verbosity.hi is missing
  file Distribution/Version.hi is missing
  file Language/Haskell/Extension.hi is missing
  file Distribution/Compat/CopyFile.hi is missing
  file Distribution/Compat/TempFile.hi is missing
  file Distribution/GetOpt.hi is missing
  file Distribution/Simple/GHC/IPI641.hi is missing
  file Distribution/Simple/GHC/IPI642.hi is missing
  file Paths_Cabal.hi is missing
  cannot find libHSCabal-1.18.1.3.a on library path
Warning: haddock-interfaces: /Library/Haskell/ghc-7.6.3/lib/haskell-platform-2013.2.0.0/doc/html/haskell-platform.haddock doesn't exist or isn't a file
Warning: haddock-html: /Library/Haskell/ghc-7.6.3/lib/haskell-platform-2013.2.0.0/doc/html doesn't exist or isn't a directory

The following packages are broken, either because they have a problem
listed above, or because they depend on a broken package.
Cabal-1.18.1.3

Why is my Haskell environment so phenomenally broken? And how can I fix it?

解决方案

One approach is to remove your local ghc package cache:

$ cd  ~/.ghc/  &&  rm -rf  */package.conf.d
$ ghc-pkg --user recache

After you do this, try the cabal command again.

$ cabal install package-name

That should work. If it doesn't, try removing your cabal packages, then repeating the above steps:

$ rm -rf  ~/.cabal

If you're still having trouble, the missing package may be referred to by the system ghc package cache. Run this command:

$ ghc-pkg --user recache
$ sudo ghc-pkg recache
$ ghc-pkg -v check

The last command should print the system cache. On my GNU/Linux sytem, it prints this:

using cache: /home/sudoman/.ghc/x86_64-linux-7.6.3/package.conf.d/package.cache
using cache: /var/lib/ghc/package.conf.d/package.cache

At that point, I don't have a solution for you based on experience, but you may want to consider removing the ghc system package cache like above, then doing a recache; or re-installing ghc/haskell-platform.

这篇关于Haskell环境泄露后重新安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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