Проблемы с настройкой Haskell (стек) для Atom (atom- haskell) - PullRequest
1 голос
/ 12 марта 2020

Я не имею понятия о haskell и пытаюсь настроить стек (stati c) 2.1.3-3 для работы с пакетом atom- haskell в Atom 1.45 на linux, но это не так за работой.

При установке atom- haskell создано 2 сообщения об ошибках: -Не удалось активировать пакет ide- haskell, результаты уже подключены! Ошибка была выброшена из пакета ide- haskell. О проблеме уже сообщалось. (github.com/atom-haskell/ide-haskell/issues/138) -Atom не смог найти исполняемый файл ghcmod

, поэтому я посмотрел на https://atom.io/packages/atom-haskell и узнал, что настроить бинарные файлы, которые я должен использовать

стековая установка gh c -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 : установка версии преобразователя в ~ / .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.

edit: setting 'allow-newer: true' в /home/bradz/.stack/config.yaml и последующем выполнении установки стека 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

Скажите, пожалуйста, как решить эту проблему.

1 Ответ

0 голосов
/ 01 апреля 2020

Если я попытался настроить двоичные файлы для пакета atom- haskell (или соответствующих зависимостей), я смог успешно установить зависимости, используя различные версии стека долгосрочной поддержки. Для gh c -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

Надеюсь, это поможет.

...