首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >与opam一起使用最新版本的zarith

与opam一起使用最新版本的zarith
EN

Stack Overflow用户
提问于 2020-06-21 18:16:55
回答 2查看 480关注 0票数 1

我使用zarith处理任意大小的整数。

我在opam.ocaml.org上可以找到的最新版本是v1.9.1 (发布于2019年8月)。在该项目的github页面上,我阅读了Latest commit a9a309d on 23 Jan (2020)。

我想换新的版本,但我该怎么做呢?我也想

  1. opam开心,并且
  2. 始终使用最新版本的zarith。

请帮帮我!

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2020-06-21 21:10:50

如果您确实需要使用未发布的、正在开发的zarith版本,则可以使用--dev-repo选项opam pin add

代码语言:javascript
运行
复制
opam pin add --dev-repo zarith
opam install zarith
票数 2
EN

Stack Overflow用户

发布于 2020-06-21 19:54:53

事实上,目前1.9.1是作为opam包(https://opam.ocaml.org/packages/zarith/)和GitHub标记(https://github.com/ocaml/Zarith/tags)提供的Zarith的最新版本。

但是,考虑到这个上游Git存储库还包含一个规格文件,您也可以使用opam安装master分支中可用的最新开发版本,或者如果需要的话,只依靠所谓的opam就可以精确地提交Git。

因此,您可以选择运行:

代码语言:javascript
运行
复制
opam pin add -n -y -k git zarith.dev --dev-repo

代码语言:javascript
运行
复制
opam pin add -n -y -k git zarith.dev "https://github.com/ocaml/Zarith.git#master"

代码语言:javascript
运行
复制
opam pin add -n -y -k git zarith.dev "https://github.com/ocaml/Zarith.git#a9a309d0596d93b6c0c902951e1cae13d661bebd"

然后:

代码语言:javascript
运行
复制
opam install zarith

关于opam-pin命令的更多细节

  1. .dev版本后缀在语法上是不需要的,但实际上是推荐的,因为zarith.opam文件没有指定任何版本。更确切地说:
代码语言:javascript
运行
复制
- If you have other dependencies that would complain of `zarith.dev` when being installed, you can replace the version suffix of `dev` with any compatible version string, "close" to the commit or branch you selected.
- However if you omit this version, `opam` will typically pick the latest version string from the [`opam` package repository](https://opam.ocaml.org/packages/) (i.e., 1.9.1), which wouldn't necessarily match the code of the Git branch or commit you selected.
  1. -n-y-k是选项的简短形式:
代码语言:javascript
运行
复制
- `--no-action` (don't install the package readily but wait the subsequent `opam install` command),
- `--yes` (answer potential yes/no questions without prompting − a common `opam pin` question is `Package foo does not exist, create as a NEW package? [Y/n]` if ever you'd want to install a custom package not yet released in the [opam-repository](https://github.com/ocaml/opam-repository)),
- `--kind=KIND` (as there are several `KINDS` of pinning, the most typical being `version`, `path`, and `git`)
票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/62502689

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档