为 Atom (atom-haskell) 配置 Haskell(堆栈)时出现问题
Problems configuring Haskell (stack) for Atom (atom-haskell)
我没有关于 haskell 的 ide 并且正在尝试设置 stack(static)2.1.3-3 以使用 Atom 1.45 中的 atom-haskell 包linux,但它不起作用。
atom-haskell 的安装创建了 2 条错误消息:
-激活ide-haskell包失败,结果已经连接!错误是从 ide-haskell-包中抛出的。该问题已被报告。 (github.com/atom-haskell/ide-haskell/issues/138)
-Atom 找不到 ghcmod 可执行文件
所以我查看了 https://atom.io/packages/atom-haskell 并了解到要设置我必须使用的二进制文件
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 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 上的 "warning" 解决:将 ~/.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' 然后执行 stack install 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
请告诉我如何解决这个问题。
如果尝试为 atom-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
希望对您有所帮助。
我没有关于 haskell 的 ide 并且正在尝试设置 stack(static)2.1.3-3 以使用 Atom 1.45 中的 atom-haskell 包linux,但它不起作用。
atom-haskell 的安装创建了 2 条错误消息: -激活ide-haskell包失败,结果已经连接!错误是从 ide-haskell-包中抛出的。该问题已被报告。 (github.com/atom-haskell/ide-haskell/issues/138) -Atom 找不到 ghcmod 可执行文件
所以我查看了 https://atom.io/packages/atom-haskell 并了解到要设置我必须使用的二进制文件
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 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 上的 "warning" 解决:将 ~/.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' 然后执行 stack install 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
请告诉我如何解决这个问题。
如果尝试为 atom-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
希望对您有所帮助。