haskell - 堆栈 : random dependency cycle(s) detected

标签 haskell cabal haskell-stack

stack.yaml内容如下:

resolver: lts-16.19

packages:
  - .

extra-deps:
  - text-1.2.4.0
  - random-1.2.0
  - git: https://github.com/LeventErkok/sbv.git # sbv
    commit: 4f4baa7b5970ef2ab9b322c6694bf9df6ccdbc4b
  - git: https://github.com/bos/aeson # aeson
    commit: 8579faf30e0f977425fbf330038fb1d5c2c34727
  - data-fix-0.3.0@sha256:058a266d1e658500e0ffb8babe68195b0ce06a081dcfc3814afc784b083fd9a5,1645
  - strict-0.4@sha256:1b50c7c9c636c3a1bbc7f8873b9be48f6ca0faca4df6eec6a014de6208fb1c0e,4200

虽然 test 有这个部分:

executable test
  hs-source-dirs:      src
  main-is:             Main.hs
  default-language:    Haskell2010
  build-depends:       text, random, sbv, aeson, base >= 4.7 && < 5

我添加了 textrandom 因为如果我不这样做,在运行 stack ghci 时会出现以下错误:

Could not load module ‘Data.Text’
Could not load module ‘System.Random’

但是现在,按照上面的方式添加了这些包,Stack 提示循环依赖:

$ stack setup
$ stack ghci

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

In the dependencies for QuickCheck-2.13.2:
    random dependency cycle detected: random, splitmix, random, uuid-types, aeson, test
needed due to test-0.1.0.0 -> QuickCheck-2.13.2

In the dependencies for test-0.1.0.0:
    random dependency cycle detected: random, splitmix, random, uuid-types, aeson, test
needed since test is a build target.

Dependency cycle detected in packages:
    [random,splitmix,random,uuid-types,aeson,test]

In the dependencies for sbv-8.8.5:
    random dependency cycle detected: random, splitmix, random, uuid-types, aeson, test
needed due to test-0.1.0.0 -> sbv-8.8.5

In the dependencies for splitmix-0.0.5:
    random dependency cycle detected: random, splitmix, random, uuid-types, aeson, test
needed due to test-0.1.0.0 -> splitmix-0.0.5

Some different approaches to resolving this:


Error: Plan construction failed.

根据错误消息,它看起来在 splitmixrandom 之间有一个循环。我只要求 random 因此我不确定如何解决这个问题。

任何解决此问题并使导入工作同时避免循环导入问题的方法都将不胜感激。

最佳答案

最新的 randomlts-16.19 快照中的旧版本 splitmix 不兼容。在 extra-deps 中添加更新版本的 splitmix:

extra-deps:
- ...  # your other extra-deps
- splitmix-0.1.0.3

关于haskell - 堆栈 : random dependency cycle(s) detected,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64524050/

相关文章:

haskell - 我的 Haskell 程序或库如何找到其版本号?

haskell - 堆栈如何解决依赖关系?

algorithm - 模块化游程编码

haskell - IO 操作的惰性评估

list - 合并元组列表和整数列表

使用 foldLine 解析多个 block

haskell - 在 OS X Yosemite 10.10 (14A389) 上安装 QuickCheck for GHC 7.8.3 时出现 Clang 错误

Haskell 软件包已安装但未找到

haskell - 从堆栈项目生成 Nix 包

windows - 如何在使用带有文件监视的堆栈进行构建之前清除控制台