无法在macOS Sierra上运行Hakyll:格式错误的mach-o:加载命令大小

时间:2017-08-24 07:36:04

标签: haskell macos-sierra cabal hakyll cabal-sandbox

我可以编译Hakyll,但是当我尝试运行它时会出现链接错误 首先我将Hakyll安装在沙盒中:

cabal sandbox init
cabal install Hakyll

这成功完成。 然后我使用hakyll-init创建一个普通站点并将文件移到目录中:

.cabal-sandbox/bin/hakyll-init mysite
mv mysite/* .
rm -rf mysite

然后我尝试用cabal exec -- runghc site.hs build运行它,然后我得到:

site.hs: <command line>: can't load .so/.DLL for: /Users/john/repositories/CP/principles-of-concurrent-programming/Website/.cabal-sandbox/lib/x86_64-osx-ghc-8.2.1/libHSpandoc-citeproc-0.10.5.1-97wWmtk04v65Etcjop52Rs-ghc8.2.1.dylib (dlopen(/Users/john/repositories/CP/principles-of-concurrent-programming/Website/.cabal-sandbox/lib/x86_64-osx-ghc-8.2.1/libHSpandoc-citeproc-0.10.5.1-97wWmtk04v65Etcjop52Rs-ghc8.2.1.dylib, 5): no suitable image found.  Did find:
    /Users/john/repositories/CP/principles-of-concurrent-programming/Website/.cabal-sandbox/lib/x86_64-osx-ghc-8.2.1/libHSpandoc-citeproc-0.10.5.1-97wWmtk04v65Etcjop52Rs-ghc8.2.1.dylib: malformed mach-o: load commands size (32992) > 32768
    /Users/john/repositories/CP/principles-of-concurrent-programming/Website/.cabal-sandbox/lib/x86_64-osx-ghc-8.2.1/libHSpandoc-citeproc-0.10.5.1-97wWmtk04v65Etcjop52Rs-ghc8.2.1.dylib: malformed mach-o: load commands size (32992) > 32768)
  • site.hs的内容完全是标准的。我已将文件上传到gist
  • GHC 8.2.1 ,通过Homebrew安装。我最初在7.10.3b遇到了这个问题,并升级了GHC,看看是否有帮助。它没有。
  • macOS Sierra 10.12.6

任何帮助将不胜感激!

1 个答案:

答案 0 :(得分:1)

虽然不能完全解决我的问题,但我设法通过堆栈安装Hakyll来解决这个问题。为了记录,这些是我的步骤:

brew install haskell-stack
stack setup
stack install hakyll

然后建立网站:

stack exec -- runghc site.hs build