我试着从源头上编译haskell ghc。我尝试从/usr/以外的不同文件夹配置我的阴谋配置。从一开始,它总是成功地构建任何包。
在某个时候(在安装了包阴谋安装之后),我改变了我的配置,以包含另一个“库-脏”。然后,会发生一些错误(可能是因为将错误的字符串插入到阴谋配置中的字段"library-dirs“中)。因此,我再次尝试重新配置我的cabal配置文件(我甚至删除了配置文件并尝试清理ghc包缓存)和注释字段"library-dirs“选项,但仍然失败。我还尝试删除了cabal目录(一个目录,在这个目录中,cabal保存有关包的缓存)。
这是使用“ghc检查”时的输出:
Warning: library-dirs: {stripped} doesn't exist or isn't a directory现在,当我使用Setup.hs构建包或手动构建包时,这就是输出:
sudo -E cabal --config-file=/opt/haskell/config/config install hashable -O2 --global --flags="-fllvm" --prefix=/opt/haskell 2>error --upgrade-dependencies --reinstall
Resolving dependencies...
Configuring hashable-1.2.1.0...
Building hashable-1.2.1.0...
Failed to install hashable-1.2.1.0
Last 10 lines of the build log ( /{stripped}/hashable-1.2.1.0.log ):
Data/Hashable/Class.hs:100:15: Warning:
Literal 15868100553162883236 is out of the Int range -9223372036854775808..9223372036854775807
[2 of 3] Compiling Data.Hashable.Generic ( Data/Hashable/Generic.hs, dist/build/Data/Hashable/Generic.o )
Data/Hashable/Generic.hs:20:1: Warning:
The import of ‛Bits’ from module ‛Data.Bits’ is redundant
[3 of 3] Compiling Data.Hashable ( Data/Hashable.hs, dist/build/Data/Hashable.o )
/usr/bin/ld: cannot find {stripped}: No such file or directory
collect2: error: ld returned 1 exit status这是一个阴谋配置文件:(任何默认值都会被删除)
remote-repo: hackage.haskell.org:http://hackage.haskell.org/packages/archive
remote-repo-cache: /opt/haskell/cabal
world-file: /opt/haskell/cabal/world
extra-prog-path: /opt/haskell/cabal/bin
build-summary: /opt/haskell/cabal/logs/build.log
remote-build-reporting: anonymous
jobs: $ncpus
install-dirs global
prefix: /opt/haskell/有人能帮助我或指引我吗?或者至少告诉我ghc到底在哪里为卸载的包保存“库-dirs”配置的信息?
cabal -V
cabal-install version 1.18.0.2
using version 1.18.1.3 of the Cabal library
ghc -v
The Glorious Glasgow Haskell Compilation System, version 7.9.20140206谢谢。
发布于 2014-06-15 20:13:03
我认为这可能是因为每个包都包含第一次创建时到达位置的完整路径。调查一下。.ghc/YOUR_PLATFORM/package.conf.d(对我来说,是.ghc/x86_64-darwin-7.6.3/package.conf.d)。您将看到许多.conf文件,每个文件都包含硬编码路径:
[...]
import-dirs: /Users/pejvan/Library/Haskell/ghc-7.6.3/lib/pandoc-types-1.12.3.3/lib
library-dirs: /Users/pejvan/Library/Haskell/ghc-7.6.3/lib/pandoc-types-1.12.3.3/lib
[...]
haddock-interfaces: /Users/pejvan/Library/Haskell/ghc-7.6.3/lib/pandoc-types-1.12.3.3/doc/html/pandoc-types.haddock
haddock-html: /Users/pejvan/Library/Haskell/ghc-7.6.3/lib/pandoc-types-1.12.3.3/doc/html您可以手动更新内容的文件以指向正确的位置,也可以编写一个脚本为您完成此操作。
然后您需要更新package.cache文件(这里和那里可能需要一个sudo ):
pejvan$ ghc-pkg recache
pejvan$ ghc-pkg recache --user
最后,检查现在一切都很好:pejvan$ ghc-pkg check
https://stackoverflow.com/questions/21642861
复制相似问题