Haskell Stack无法安装easyrender

时间:2017-11-26 00:54:26

标签: haskell packages ghc cabal haskell-stack

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

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

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,但这并没有做任何事情。引用的日志文件只是与输出相同。

想法? 森

2 个答案:

答案 0 :(得分:3)

这是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页面。我已通过电子邮件通知作者,要求他解决此问题。

答案 1 :(得分:2)

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的依赖,而堆栈则没有。

只是为了检查,我尝试过并可能产生同样的问题,但将Cabal添加到setup-depends:的{​​{1}}行,这样就可以了。