为原子(atom-haskell)配置Haskell(堆栈)的问题

问题描述 投票:1回答:1

我对haskell不了解,正在尝试设置stack(static)2.1.3-3与Linux上的Atom 1.45中的atom-haskell软件包一起使用,但是不起作用。

atom-haskell的安装创建了2条错误消息:-无法激活ide-haskell软件包,结果已连接!该错误是由ide-haskell-package引发的。该问题已被报告。 (github.com/atom-haskell/ide-haskell/issues/138)-Atom找不到ghcmod可执行文件

所以我看了看https://atom.io/packages/atom-haskell并了解到设置我必须使用的二进制文件

堆栈安装ghc-mod hoogle hasktags指向无意义的阴谋安装

但是那不起作用:

Error: While constructing the build plan, the following exceptions were encountered:

In the dependencies for cabal-install-3.0.0.0:
    base-4.13.0.0 from stack configuration does not match >=4.8 && <4.13  (latest matching version is 4.12.0.0)
    hackage-security must match >=0.5.2.2 && <0.6, but the stack configuration has no specified version  (latest matching version is
0.5.3.0) needed since cabal-install is a build target.

In the dependencies for ghc-mod-5.8.0.0:
    Cabal-3.0.1.0 from stack configuration does not match >=1.18 && <1.25  (latest matching version is 1.24.2.0)
    base-4.13.0.0 from stack configuration does not match >=4.6.0.1 && <4.10  (latest matching version is 4.9.1.0)
    cabal-helper must match <0.8 && >=0.7.3.0, but the stack configuration has no specified version  (latest matching version is
0.7.3.0)
    djinn-ghc must match <0.1 && >=0.0.2.2, but the stack configuration has no specified version  (latest matching version is
0.0.2.3)
    extra-1.6.20 from stack configuration does not match <1.6 && >=1.4  (latest matching version is 1.5.3)
    fclabels must match ==2.0.*, but the stack configuration has no specified version  (latest matching version is 2.0.4)
    ghc-8.8.2 from stack configuration does not match >=7.6 && <8.2 
    ghc-syb-utils must match <0.3 && >=0.2.3, but the stack configuration has no specified version  (latest matching version is
0.2.3.3)
    haskell-src-exts-1.22.0 from stack configuration does not match <1.20 && >=1.18  (latest matching version is 1.19.1)
    hlint-2.2.11 from stack configuration does not match <2.1 && >=2.0.8  (latest matching version is 2.0.15)
    monad-journal-0.8.1 from stack configuration does not match <0.8 && >=0.4  (latest matching version is 0.7.2)
    optparse-applicative-0.15.1.0 from stack configuration does not match >=0.13.0.0 && <0.14  (latest matching version is 0.13.2.0)
    semigroups-0.19.1 from stack configuration does not match >=0.10.0 && <0.19  (latest matching version is 0.18.5)
    temporary-1.3 from stack configuration does not match <1.3 && >=1.2.0.3  (latest matching version is 1.2.1.1) needed since ghc-mod is a build target.

In the dependencies for hasktags-0.71.2:
    json must match >=0.5 && <0.11, but the stack configuration has no specified version  (latest matching version is 0.10) needed since hasktags is a build target.

In the dependencies for pointfree-1.1.1.6:
    base-4.13.0.0 from stack configuration does not match >=4.5 && <4.13  (latest matching version is 4.12.0.0)
    haskell-src-exts-1.22.0 from stack configuration does not match ==1.20.*  (latest matching version is 1.20.3) needed since pointfree is a build target.

In the dependencies for pointful-1.1.0.0:
    haskell-src-exts-simple must match >=1.18 && <1.21 || ^>=1.21, but the stack configuration has no specified version  (latest matching version is 1.21.1.0) needed since pointful is a build target.

ghcmod问题通过https://atom-haskell.github.io/core-packages/haskell-ghc-mod/#using-with-stack上的“警告”解决:将〜/ .stack / global-project / stack.yaml中的解析器版本设置为lts-9.21(它表示为“ lts-9”-还会更多)正确?)。该网站上有更多说明,但我不理解。

现在有一个新错误:

Error: While constructing the build plan, the following exceptions were encountered:

In the dependencies for pointfree-1.1.1.6:
    haskell-src-exts-1.18.2 from stack configuration does not match ==1.20.*  (latest matching version is 1.20.3)
needed since pointfree is a build target.
Some different approaches to resolving this:

  * Set 'allow-newer: true' in /home/bradz/.stack/config.yaml to ignore all version constraints and build anyway.

  * Recommended action: try adding the following to your extra-deps in /home/bradz/.stack/global-project/stack.yaml:

- haskell-src-exts-1.20.3@sha256:83ae523bbec907a42c043de1f5bbf4c1554e7c3b898af07bb1ce6e80eaa282ec,4589

Plan construction failed.

所以我遵循了建议并将其添加到我的stack.yaml中,现在看起来像这样:

packages: []
resolver: lts-9.21
extra-deps:
- haskell-src-exts-1.20.3@sha256:83ae523bbec907a42c043de1f5bbf4c1554e7c3b898af07bb1ce6e80eaa282ec,4589

但是那似乎有点不对,因为现在我又遇到了ghcmod错误,甚至更多:

$ stack install ghc-mod hoogle hasktags pointfree pointful cabal-install

Error: While constructing the build plan, the following exceptions were encountered:

In the dependencies for ghc-mod-5.8.0.0:
    haskell-src-exts-1.20.3 from stack configuration does not match <1.20 && >=1.18  (latest matching version is 1.19.1)
needed since ghc-mod is a build target.

In the dependencies for haskell-src-exts-simple-1.19.0.0:
    haskell-src-exts-1.20.3 from stack configuration does not match >=1.18 && <1.20  (latest matching version is 1.19.1)
needed due to pointful-1.0.9 -> haskell-src-exts-simple-1.19.0.0

In the dependencies for hlint-2.0.11:
    haskell-src-exts-1.20.3 from stack configuration does not match >=1.18 && <1.20  (latest matching version is 1.19.1)
needed due to ghc-mod-5.8.0.0 -> hlint-2.0.11

In the dependencies for hoogle-5.0.14:
    haskell-src-exts-1.20.3 from stack configuration does not match >=1.18 && <1.20  (latest matching version is 1.19.1)
needed since hoogle is a build target.

Some different approaches to resolving this:

  * Set 'allow-newer: true' in /home/bradz/.stack/config.yaml to ignore all version constraints and build anyway.

  * Recommended action: try adding the following to your extra-deps in /home/bradz/.stack/global-project/stack.yaml:

- haskell-src-exts-1.19.1@sha256:30176fc34fb3a4eba0a7c31e50a2b09c70aab422e784de9f6b437eabe7de1288,4235

Plan construction failed.

编辑:在/home/bradz/.stack/config.yaml中设置“ allow-newer:true”,然后执行pointfree的堆栈安装也不起作用:

WARNING: Ignoring pointfree's bounds on haskell-src-exts (==1.20.*); using haskell-src-exts-1.18.2.
Reason: allow-newer enabled.

(...) (~300 lines omitted)

haskell-src-exts> Registering haskell-src-exts-1.18.2...
pointfree       > configure   
pointfree       > Configuring pointfree-1.1.1.6...
pointfree       > build
pointfree       > Building pointfree-1.1.1.6...
pointfree       > Preprocessing library pointfree-1.1.1.6...
pointfree       > [1 of 7] Compiling Plugin.Pl.Common ( Plugin/Pl/Common.hs, .stack-work/dist/x86_64-linux-tinfo6/Cabal-1.24.2.0/build/Plugin/Pl/Common.o )
pointfree       > [2 of 7] Compiling Plugin.Pl.Parser ( Plugin/Pl/Parser.hs, .stack-work/dist/x86_64-linux-tinfo6/Cabal-1.24.2.0/build/Plugin/Pl/Parser.o )
pointfree       >      
pointfree       > /tmp/stack2192/pointfree-1.1.1.6/Plugin/Pl/Parser.hs:25:3: error:
pointfree       >     • Couldn't match expected type ‘HSE.SpecialCon a’
pointfree       >                   with actual type ‘HSE.Exp t0’
pointfree       >     • In the pattern: HSE.ExprHole {}
pointfree       >       In a case alternative: HSE.ExprHole {} -> todo sc
pointfree       >       In the expression:
pointfree       >         case sc of {
pointfree       >           HSE.UnitCon _ -> (Pref, "()")
pointfree       >           HSE.ListCon _ -> (Pref, "[]")
pointfree       >           HSE.FunCon _ -> (Inf, "->")
pointfree       >           HSE.TupleCon _ HSE.Boxed n -> (Inf, replicate (n - 1) ',')
pointfree       >           HSE.TupleCon {} -> todo sc
pointfree       >           HSE.Cons _ -> (Inf, ":")
pointfree       >           HSE.UnboxedSingleCon {} -> todo sc
pointfree       >           HSE.ExprHole {} -> todo sc }
pointfree       >     • Relevant bindings include
pointfree       >         sc :: HSE.SpecialCon a (bound at Plugin/Pl/Parser.hs:17:28)
pointfree       >         qnameString :: HSE.QName a -> (Fixity, String)
pointfree       >           (bound at Plugin/Pl/Parser.hs:15:1)
Completed 9 action(s). 

--  While building package pointfree-1.1.1.6 using:
      /home/bradz/.stack/setup-exe-cache/x86_64-linux-tinfo6/Cabal-simple_mPHDZzAJ_1.24.2.0_ghc-8.0.2 --builddir=.stack-work/dist/x86_64-linux-tinfo6/Cabal-1.24.2.0 build --ghc-options ""
    Process exited with code: ExitFailure 1

请告诉我如何解决。

haskell atom-editor haskell-stack
1个回答
0
投票

如果尝试为atomic-haskell软件包(或适用的依赖项)设置二进制文件,则能够使用不同的长期支持堆栈版本来成功安装依赖项。对于ghc-mod,hoogle,pointful和cabal-install,我使用lts-9.21;对于hasktags,pointfree和brittany,我使用lts-11.22 =>

stack --resolver lts-9.21 install ghc-mod hoogle pointful cabal-install

stack --resolver lts-11.22 install hasktags pointfree brittany

我希望这会有所帮助。

© www.soinside.com 2019 - 2024. All rights reserved.