取决于cabal中的本地包 [英] Depending on a local package in cabal

查看:102
本文介绍了取决于cabal中的本地包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经编写了一些包含一些额外函数的包,用于处理反映我喜欢使用它们的方式的常见类型(例如,我更愿意将Bson文档视为地图,而不是字段列表)。我将这些包保存在本地源代码目录中,而不是在Hackage上。



我想介绍这些包在它们的 .cabal 文件,使用cabal的 build-depends 系统。但是这会导致下面的错误( bson-docmap 是一个本地模块):

  cabal:至少缺少以下依赖项:
bson-docmap> = 0.0

是否可以将cabal指向本地目录作为备用存储库?



我当前的解决方法是将所有模块保留在单个本地包中,但如果可能的话,我宁愿将它们分开。如果你使用的是Cabal沙箱,那么你可以添加一个本地的Cabalized目录作为源

  cabal沙箱添加源路径/ to / project / dir 

在此之后,它可用于 build-depends


I've written a few packages containing some extra functions for dealing with common types that reflect the way I like to use them (for instance, I prefer to treat Bson documents as maps, rather than lists of fields). I keep these packages in local source directories, not on Hackage.

I would like to introduce dependencies between these packages in their .cabal files, using cabal's build-depends system. But this leads to the following error (bson-docmap being a local module):

cabal: At least the following dependencies are missing:
bson-docmap >=0.0

Is it possible to point cabal to a local directory as an alternate repository?

My current workaround is to keep all my modules in a single local package, but I would prefer to break them apart if possible.

解决方案

If you're using Cabal sandboxes then you can add a local Cabalized directory as a source

cabal sandbox add-source path/to/project/dir

After this point it'll be available for build-depends.

这篇关于取决于cabal中的本地包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆