Haskell Stack从github安装软件包依赖项 [英] Haskell Stack install package dependency from github

查看:347
本文介绍了Haskell Stack从github安装软件包依赖项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用Haskell堆栈从github安装一个包版本?

Is it possible to install a version of a package from github using Haskell stack?

例如。在一个 .cabal 或一个 stack.yaml 文件中,我怎么能指出一个依赖于一个git repo / branch /修正?

e.g. in a .cabal or a stack.yaml file, how can I point a dependency at a git repo/branch/revision?

推荐答案

stack.yaml packages 部分的文档提供了涉及更复杂的软件包位置的示例。

The documentation for the stack.yaml packages section gives examples of referring to more complex package locations.


packages:
- location: .
- location: dir1/dir2
- location: https://example.com/foo/bar/baz-0.0.2.tar.gz
- location: http://github.com/yesodweb/wai/archive/2f8a8e1b771829f4a8a77c0111352ce45a14c30f.zip
- location:
    git: git@github.com:commercialhaskell/stack.git
    commit: 6a86ee32e5b869a877151f74064572225e1a0398
- location:
    hg: https://example.com/hg/repo
    commit: da39a3ee5e6b4b0d3255bfef95601890afd80709


然后在包条目中添加 extra-dep:true 告诉 stack 不要把它作为你正在开发的代码处理(例如,不要把它加载到GHCi中)。

Then add extra-dep: true to the package entry just to tell stack not to treat the code it pulls in as something you're developing on (e.g., don't load it in GHCi).

这篇关于Haskell Stack从github安装软件包依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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