haskell - "Could not find module ‘Distribution.PackageDescription.Parse’ 使用 haskell 堆栈安装 Haskelly 扩展依赖项时出现错误

标签 haskell haskell-stack

我正在尝试按照步骤 here 安装适用于 vs studio 代码的 Haskelly 扩展.

    rajkumar@linux-2278:~> stack install intero QuickCheck stack-run
    stack-run-0.1.1.4: configure
    stack-run-0.1.1.4: build

    --  While building package stack-run-0.1.1.4 using:
        /home/rajkumar/.stack/setup-exe-cache/x86_64-linux-tinfo6/Cabal-simple_mPHDZzAJ_2.4.0.1_ghc-8.6.5 --builddir=.stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1 build --ghc-options " -ddump-hi -ddump-to-file -fdiagnostics-color=always"
        Process exited with code: ExitFailure 1
        Logs have been written to: /home/rajkumar/.stack/global-project/.stack-work/logs/stack-run-0.1.1.4.log

        Configuring stack-run-0.1.1.4...
        Preprocessing executable 'stack-run' for stack-run-0.1.1.4..
        Building executable 'stack-run' for stack-run-0.1.1.4..

        /tmp/stack30563/stack-run-0.1.1.4/unix/System/Console/Questioner.hs:4:14: warning:
            -XOverlappingInstances is deprecated: instead use per-instance pragmas OVERLAPPING/OVERLAPPABLE/OVERLAPS
        |
        4 | {-# LANGUAGE OverlappingInstances  #-}
        |              ^^^^^^^^^^^^^^^^^^^^
        [1 of 5] Compiling System.Console.Questioner.Autocomplete ( unix/System/Console/Questioner/Autocomplete.hs, .stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1/build/stack-run/stack-run-tmp/System/Console/Questioner/Autocomplete.o )
        [2 of 5] Compiling System.Console.Questioner.Util ( unix/System/Console/Questioner/Util.hs, .stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1/build/stack-run/stack-run-tmp/System/Console/Questioner/Util.o )
        [3 of 5] Compiling System.Console.Questioner.ProgressIndicators ( unix/System/Console/Questioner/ProgressIndicators.hs, .stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1/build/stack-run/stack-run-tmp/System/Console/Questioner/ProgressIndicators.o )
        [4 of 5] Compiling System.Console.Questioner ( unix/System/Console/Questioner.hs, .stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1/build/stack-run/stack-run-tmp/System/Console/Questioner.o )
        [5 of 5] Compiling Main             ( src/Main.hs, .stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1/build/stack-run/stack-run-tmp/Main.o )

        /tmp/stack30563/stack-run-0.1.1.4/src/Main.hs:18:1: error:
            Could not find module ‘Distribution.PackageDescription.Parse’
            Perhaps you meant
            Distribution.PackageDescription.Parsec (needs flag -package-key Cabal-2.4.0.1)
            Distribution.PackageDescription.Parsec (from Cabal-2.4.1.0)
            Distribution.PackageDescription.Check (needs flag -package-key Cabal-2.4.0.1)
            Use -v to see a list of the files searched for.
        |
        18 | import           Distribution.PackageDescription.Parse

以下是/home/rajkumar/.stack/global-project/stack.yaml的内容 -

    packages: []
    resolver: lts-13.21
    allow-newer: true
    extra-deps:
    - conduit-1.2.13.1
    - conduit-extra-1.1.17
    - resourcet-1.1.11
    - streaming-commons-0.1.19

cabal 版本 -

    $ cabal --version
    cabal-install version 2.4.1.0
    compiled using version 2.4.1.0 of the Cabal library 

堆栈版本-

    $ stack --version
    Version 1.9.3, Git revision 40cf7b37526b86d1676da82167ea8758a854953b (6211 commits) x86_64 hpack-0.31.1

以下是 OpenSuse 操作系统详细信息 -

    rajkumar@linux-2278:~> lsb_release -a
    LSB Version:    core-2.0-noarch:core-3.2-noarch:core-4.0-noarch:core-2.0-x86_64:core-3.2-x86_64:core-4.0-x86_64:desktop-4.0-amd64:desktop-4.0-noarch:graphics-2.0-amd64:graphics-2.0-noarch:graphics-3.2-amd64:graphics-3.2-noarch:graphics-4.0-amd64:graphics-4.0-noarch
    Distributor ID: openSUSE
    Description:    openSUSE Leap 15.0
    Release:        15.0
    Codename:       n/a

Fedora 30 操作系统中也会发生这种情况 -

    $ lsb_release -a
    LSB Version:    :core-4.1-amd64:core-4.1-noarch
    Distributor ID: Fedora
    Description:    Fedora release 30 (Thirty)
    Release:        30
    Codename:       Thirty 

我不知道如何解决这个问题。任何想法都会有帮助。

最佳答案

您正在运行 Cabal 版本 2.4,包 Distribution.PackageDescription.Parse 已在 Cabal 2.2 中删除。 See Cabal issue tracker .

考虑使用Distribution.PackageDescription.Parsec代替。 They are using that in obelisk project .

关于haskell - "Could not find module ‘Distribution.PackageDescription.Parse’ 使用 haskell 堆栈安装 Haskelly 扩展依赖项时出现错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56160068/

相关文章:

haskell - 是否可以像NPM(NodeJS)一样设计Stack(Haskell)?

macos - 为什么 Haskell Stack 在尝试构建我的项目时挂起?

haskell - hamletFile、luciusFile、juliusFile 变量不在范围内

haskell - 编写一个函数,通过 k 步列出从 n 到 m 的数字。如果步长为负数,则按降序排列

haskell - 单子(monad)内的值,嵌套在数据结构中?

javascript - 'map' ping multiple lists有名称吗?

haskell - 为什么不懒惰

c++ - 为 haskell 堆栈项目编写静态 cpp 库

haskell - 使用 GHCJS 和 Haskell Stack 将 Haskell 编译为 JavaScript

haskell - 了解此 Haskell 程序的内存使用情况