我正在尝试从源代码编译haskell ghc。我尝试从与 /usr/ 不同的文件夹配置我的 cabal 配置。从一开始它总是成功地构建任何包。
在某些时候(安装包 cabal-install 之后),我更改了 cabal 的配置以包含另一个“library-dirs”。然后,发生了一些错误(可能是因为在 cabal 配置中的“library-dirs”字段中插入了错误的字符串)。因此,我尝试再次重新配置我的 cabal 配置文件(我什至删除了配置文件并尝试清理 ghc 包缓存)并注释字段“library-dirs”选项,但它仍然失败。我也已经尝试删除 cabal 包目录(cabal 保存有关包的缓存的目录)。
这是使用“ghc-pkg check”时的输出:
Warning: library-dirs: {stripped} doesn't exist or isn't a directory
这是我使用 cabal 或手动从 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
这是 cabal 配置文件:(任何默认值都被剥离)
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 实际上在哪里保存已卸载软件包的“library-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
谢谢你。