Haskell 堆栈无法安装 easyrender

Haskell Stack failing to install easyrender

我在 Haskell 堆栈上安装了 GHC 8.0.2,我的项目需要一定数量的包,其中一个是 easyrender。

我使用以下命令安装它,它适用于所有其他软件包安装:

stack install easyrender

我得到以下输出:

easyrender-0.1.1.2: configure

--  While building package easyrender-0.1.1.2 using:
  /home/nathan/.stack/programs/x86_64-linux/ghc-8.0.2/bin/ghc --make -odir /tmp/stack5987/easyrender-0.1.1.2/.stack-work/dist/x86_64-linux/Cabal-1.24.2.0/setup -hidir /tmp/stack5987/easyrender-0.1.1.2/.stack-work/dist/x86_64-linux/Cabal-1.24.2.0/setup -i -i. -clear-package-db -global-package-db -package-db=/home/nathan/.stack/snapshots/x86_64-linux/ghc-8.0.2/8.0.2/pkgdb -package-db=/home/nathan/.stack/global-project/.stack-work/install/x86_64-linux/ghc-8.0.2/8.0.2/pkgdb -hide-all-packages -package-id=base-4.9.1.0 -package-id=superdoc-0.1.2.5-9gGVGYAJpHrGct376cUN41 -optP-include -optP/tmp/stack5987/easyrender-0.1.1.2/.stack-work/dist/x86_64-linux/Cabal-1.24.2.0/setup/setup_macros.h /tmp/stack5987/easyrender-0.1.1.2/Setup.hs /home/nathan/.stack/setup-exe-src/setup-shim-mPHDZzAJ.hs -main-is StackSetupShim.mainOverride -o /tmp/stack5987/easyrender-0.1.1.2/.stack-work/dist/x86_64-linux/Cabal-1.24.2.0/setup/setup -threaded
Process exited with code: ExitFailure 1
Logs have been written to: /home/nathan/.stack/global-project/.stack-work/logs/easyrender-0.1.1.2.log

[1 of 2] Compiling Main             ( /tmp/stack5987/easyrender-0.1.1.2/Setup.hs, /tmp/stack5987/easyrender-0.1.1.2/.stack-work/dist/x86_64-linux/Cabal-1.24.2.0/setup/Main.o )
[2 of 2] Compiling StackSetupShim   ( /home/nathan/.stack/setup-exe-src/setup-shim-mPHDZzAJ.hs, /tmp/stack5987/easyrender-0.1.1.2/.stack-work/dist/x86_64-linux/Cabal-1.24.2.0/setup/StackSetupShim.o )

/home/nathan/.stack/setup-exe-src/setup-shim-mPHDZzAJ.hs:3:1: error:
    Failed to load interface for ‘Distribution.PackageDescription’
    It is a member of the hidden package ‘Cabal-2.0.1.0’.
    It is a member of the hidden package ‘Cabal-1.24.2.0’.
    Use -v to see a list of the files searched for.

/home/nathan/.stack/setup-exe-src/setup-shim-mPHDZzAJ.hs:4:1: error:
    Failed to load interface for ‘Distribution.Simple’
    It is a member of the hidden package ‘Cabal-2.0.1.0’.
    It is a member of the hidden package ‘Cabal-1.24.2.0’.
    Use -v to see a list of the files searched for.

/home/nathan/.stack/setup-exe-src/setup-shim-mPHDZzAJ.hs:5:1: error:
    Failed to load interface for ‘Distribution.Simple.Build’
    It is a member of the hidden package ‘Cabal-2.0.1.0’.
    It is a member of the hidden package ‘Cabal-1.24.2.0’.
    Use -v to see a list of the files searched for.

/home/nathan/.stack/setup-exe-src/setup-shim-mPHDZzAJ.hs:6:1: error:
    Failed to load interface for ‘Distribution.Simple.Setup’
    It is a member of the hidden package ‘Cabal-2.0.1.0’.
    It is a member of the hidden package ‘Cabal-1.24.2.0’.
    Use -v to see a list of the files searched for.

/home/nathan/.stack/setup-exe-src/setup-shim-mPHDZzAJ.hs:7:1: error:
    Failed to load interface for ‘Distribution.Simple.LocalBuildInfo’
    It is a member of the hidden package ‘Cabal-2.0.1.0’.
    It is a member of the hidden package ‘Cabal-1.24.2.0’.
    Use -v to see a list of the files searched for.

由于 Cabal 似乎是个问题,我尝试了 运行 stack install Cabal,但这没有任何作用。引用的日志文件与输出的内容相同。

想法? 内森

cabal-install 没有这样的问题:

% cabal install easyrender
Resolving dependencies...
Downloading superdoc-0.1.2.5...
Configuring superdoc-0.1.2.5...
Building superdoc-0.1.2.5...
Installed superdoc-0.1.2.5
Downloading easyrender-0.1.1.2...
Configuring easyrender-0.1.1.2...
Building easyrender-0.1.1.2...
Installed easyrender-0.1.1.2

所以我猜这是堆栈以不同方式处理非简单构建的问题。即,cabal-install 似乎假定 Cabal 是 setup.hs 的依赖项,而 stack 则不是。

只是为了检查一下,我试过了并且可能会产生同样的问题,但是将 Cabal 添加到 easyrender.cabalsetup-depends: 行使其工作正常。

这是 easyrender 包描述中的错误。请注意,cabal-install 的 "new-build" 遇到了同样的问题。请参阅我对此堆栈问题的评论:https://github.com/commercialhaskell/stack/issues/3560#issuecomment-344075524

Thomas 的回答以及 https://github.com/commercialhaskell/stack/issues/3560#issuecomment-343980627

中的问题中描述了解决方法

下一个堆栈版本将针对这种情况发出警告,这应该会减少将来的混淆。

不幸的是,easyrender 没有问题跟踪器,它似乎只有一个 hackage 页面。我已经给作者发邮件要求他解决这个问题。