我需要一些方法来在内部包之间共享私有代码。在这种情况下,我有一个名为cra-products
的项目,它取决于risk-types
。 risk-types
需要在多个项目之间共享,并且不能公开。
我正在使用stack和packages节点依赖risk-types
这样:
packages:
- '.'
- location:
git: git@git.xxxx.com:risk/risk-types.git
commit: 9653ca15
extra-dep: true
但risk-types
本身取决于索引中不包含的其他代码:refined
,which is on Hackage和validated-types
,which is something I wrote on github(尚未发布) ,因为我还在努力)。
这是risk-types
'stack.yaml:
packages:
- '.'
- location:
git: https://github.com/seanhess/validated-types.git
commit: fc59f3d
extra-dep: true
extra-deps:
- validated-types-0.1.0.0
- refined-0.1.2.1
当我构建cra-products
时,我收到此错误:
$ stack build
Warning: Some extra-deps are neither installed nor in the index:
* risk-types-0.1.0.0
Error: While constructing the build plan, the following exceptions were encountered:
In the dependencies for risk-types-0.1.0.0:
refined must match -any, but the stack configuration has no specified version (latest applicable is 0.1.2.1)
validated-types must match -any, but the stack configuration has no specified version
needed due to cra-products-0.1.0.0 -> risk-types-0.1.0.0
Recommended action: try adding the following to your extra-deps in /Users/seanhess/projects/simple/cra-products/stack.yaml:
- refined-0.1.2.1
即使我将refined
添加到cra-products
的extra-deps部分,我仍然会收到validated-types
的错误消息。我不想这样做,因为我的项目目前并不直接依赖于risk-types
上的任何一个。我该如何解决这个问题?