使用 stack 安装 shuffle 库时出错

Error installing the shuffle library with stack

使用 stack 1.2.0LTS 7.0 安装 shuffle 库时出现以下错误:

$ cabal get shuffle
$ cd shuffle-0.1.3.3
$ stack build
...
/tmp/shuffle-0.1.3.3/Setup.hs:2:1: error:
    Failed to load interface for ‘Distribution.Simple.UUAGC’
    Perhaps you meant
      Distribution.Simple.UHC (from Cabal-1.24.0.0)
      Distribution.Simple.GHC (from Cabal-1.24.0.0)
      Distribution.Simple.JHC (from Cabal-1.24.0.0)
    Use -v to see a list of the files searched for.

/tmp/shuffle-0.1.3.3/Setup.hs:3:1: error:
    Failed to load interface for ‘UU.UUAGC’
    Use -v to see a list of the files searched for.

--  While building package shuffle-0.1.3.3 using:
      /usr/local/bin/ghc --make -odir /tmp/shuffle-0.1.3.3/.stack-work/dist/x86_64-linux/Cabal-1.24.0.0/setup -hidir /tmp/shuffle-0.1.3.3/.stack-work/dist/x86_64-linux/Cabal-1.24.0.0/setup -i -i. -package=Cabal-1.24.0.0 -clear-package-db -global-package-db -package-db=/home/asr/.stack/snapshots/x86_64-linux/lts-7.0/8.0.1/pkgdb /tmp/shuffle-0.1.3.3/Setup.hs -o /tmp/shuffle-0.1.3.3/.stack-work/dist/x86_64-linux/Cabal-1.24.0.0/setup/setup
    Process exited with code: ExitFailure 1

我正在使用以下 stack.yaml 文件:

resolver: lts-7.0

# Local packages, usually specified by relative directory name
packages:
- '.'
extra-deps:
- logict-state-0.1.0.2
- pqueue-1.3.1.1
- uhc-util-0.1.6.6
- uuagc-0.9.52.1
- uuagc-cabal-1.0.6.0
- uulib-0.9.22

我需要 add/change 图书馆或 stack.yaml 的东西吗? (我使用 cabal-install 没有问题)。

看来此软件包需要您安装 uuagc-cabal 才能构建它。从 Cabal-1.23 开始,这些 Setup.hs 文件的依赖包可以在 cabal 文件的 custom-setup 部分中捕获。

关于堆栈的此功能的票证似乎与此处相互关联:

我可以通过将以下内容添加到 stack.yaml 来让它工作:

explicit-setup-deps:
    shuffle: true

有关详细信息,请参阅:https://docs.haskellstack.org/en/stable/yaml_configuration/#explicit-setup-deps