cabal:haskell-gi-base拒绝安装

时间:2017-01-10 14:01:45

标签: haskell cabal

当我尝试

#include <iostream>

template <typename T>
class Base
{
public:
    static constexpr int y() {return T::x();}
};

class Derived : public Base<Derived>
{
public:
    static constexpr int x() {return 5;}
};

int main()
{
    std::cout << Derived::y() << std::endl;
}

(安装leksah的一长串依赖项)我收到以下错误:

$ cabal install gi-cairo

我看到关于Resolving dependencies... Configuring haskell-gi-base-0.9... Building haskell-gi-base-0.9... Failed to install haskell-gi-base-0.9 Build log ( /home/brandon/.cabal/logs/haskell-gi-base-0.9.log ): Configuring haskell-gi-base-0.9... Building haskell-gi-base-0.9... Preprocessing library haskell-gi-base-0.9... src/Data/GI/Base/Attributes.hs:105:8: Could not find module `Data.Proxy' It is a member of the hidden package `tagged-0.8.5'. Perhaps you need to add `tagged' to the build-depends in your .cabal file. Use -v to see a list of the files searched for. cabal: Error: some packages failed to install: gi-cairo-0.1.14.8 depends on haskell-gi-base-0.9 which failed to install. haskell-gi-base-0.9 failed during the building phase. The exception was: ExitFailure 1 的部分,但这个tagged文件在哪里?在我的机器上,它是.cabal的目录,而不是文件。我该添加到这个假设的文件中?

顺便说一句,~/.cabal/的输出:

cabal --version

我的目标是在运行时安装cabal-install version 1.20.0.3 using version 1.20.0.2 of the Cabal library 输出的依赖项:

leksah.sh

自昨晚以来,我一直在努力解决这个问题,但是当我在谷歌的任何地方,我都没有看到这样的事情。

更新:当我尝试运行gi-cairo >=1.0.6 && <1.1, gi-gdk >=3.0.6 && <3.1, gi-gdkpixbuf >=2.0.6 && <2.1, gi-gio >=2.0.6 && <2.1, gi-glib >=2.0.6 && <2.1, gi-gobject >=2.0.6 && <2.1, gi-gtk >=3.0.6 && <3.1, gi-gtk-hs >=0.3.1.0 && <0.4, gi-gtksource >=3.0.6 && <3.1, gi-pango >=1.0.6 && <1.1, gi-webkit2 >=4.0.6 && <4.1, haskell-gi-base >=0.18 && <0.21, haskell-src-exts >=1.13.5 && <1.19, leksah-server >=0.16.1.0 && <0.17, ltk >=0.16.0.0 && <0.17, regex-tdfa >=1.1 && <1.3, regex-tdfa-text -any, vcsgui >=0.2.0 && <0.3 时,我收到以下错误:

cabal install leksah

所以我按照cabal的联机帮助页面尝试了Resolving dependencies... cabal: Could not resolve dependencies: trying: leksah-0.15.2.0 (user goal) trying: vcswrapper-0.1.1/installed-1eQ... (dependency of leksah-0.15.2.0) next goal: transformers (dependency of leksah-0.15.2.0) rejecting: transformers-0.5.2.0/installed-3Es... (conflict: leksah => transformers>=0.2.2.0 && <0.5) rejecting: transformers-0.3.0.0/installed-ff2... (conflict: transformers-compat-0.5.1.4:three => transformers>=0.4.1 && <0.6) rejecting: transformers-0.5.2.0, 0.5.1.0, 0.5.0.1, 0.5.0.0 (conflict: leksah => transformers>=0.2.2.0 && <0.5) trying: transformers-0.4.3.0 next goal: mtl (dependency of leksah-0.15.2.0) rejecting: mtl-2.2.1/installed-4vs... (conflict: transformers==0.4.3.0, mtl => transformers==0.5.2.0/installed-3Es...) rejecting: mtl-2.1.2/installed-94c..., 2.2.1, 2.2.0.1, 2.2, 2.1.3.1, 2.1.2, 2.1.1, 2.1, 2.0.1.1, 2.0.1.0, 2.0.0.0, 1.1.1.1, 1.1.1.0, 1.1.0.2, 1.1.0.1, 1.1.0.0, 1.0 (conflict: vcswrapper => mtl==2.2.1/installed-4vs...) Backjump limit reached (change with --max-backjumps). ,大约10分钟后它现在耗费了我机器内存的40%左右,所以我根本无法继续使用该路线。

1 个答案:

答案 0 :(得分:0)

Data.Proxy模块已转移到base base-4.7.0.0系列ghc-7.6中的haskell-gi-base包。您尝试安装的<!DOCTYPE html> <html> <body> <p>Click the button to decode a base-64 encoded string.</p> <button onclick="myFunction()">Try it</button> <p><strong>Note:</strong> The atob() method is not supported in IE9 and earlier.</p> <p id="demo"></p> <script> function myFunction() { var str = "Hello World!"; var enc = window.btoa(str); var dec = window.atob(enc); var res = "Encoded String: " + enc + "<br>" + "Decoded String: " + dec; document.getElementById("demo").innerHTML = res; } </script> </body> </html>也很老。我希望它被选中是因为最新版本可以满足版本约束,但那些版本约束是错误的。您的GHC版本必须早于此版本。

解决方案是更新GHC和cabal-install。当前版本的GHC 8.0.2和当前版本的cabal-install是1.24.0.2。升级到GHC 8时,至少需要1.24版本的cabal-install。幸运的是,Minimal Haskell平台配备了最新的GHC,cabal-install甚至堆栈!