简体   繁体   English

为什么我在使用git时遇到错误,而不是在rebar3中使用hex deps

[英]Why am I getting errors with git but not with hex deps in rebar3

I've come across this issue several times when using dependencies in my Erlang projects, such as 在我的Erlang项目中使用依赖项时,我多次遇到过这个问题,例如

{rabbit_common, "3.7.8"}

vs VS

{rabbit_common, ".*", {git, "https://github.com/rabbitmq/rabbitmq-common.git", {tag, "v3.7.8"}}

When using git I had to go into each dependency app in lib folder and run make on it while with hex everything just worked. 当使用git时,我必须进入lib文件夹中的每个依赖项应用程序并在其上运行make,而使用hex一切正常工作。

Also, when docker-izing my app I found that I got an error 此外,当我的应用程序停泊时,我发现我收到了一个错误

no release found 没有找到发布

when using any git deps, but when I switched all to hex it worked fine. 当使用任何git deps时,但当我将所有切换为十六进制时,它工作正常。 Is git dead for rebar3? rebar3的git死了吗?

By default, rabbit_common in its github repository only supports erlang.mk as a build tool, and does not contain the data rebar3 would require (in rebar.config) to build it successfully. 默认情况下, rabbit_common在GitHub的仓库只支持erlang.mk作为构建工具,并且不包含数据rebar3将需要(在rebar.config)成功地建立它。

Rebar3 is able to go in and try to compile an application that looks like it respects OTP, but in this case, particularly because deps are missing, rebar3 won't be able to know that some components are not in place. Rebar3能够进入并尝试编译一个看起来像是尊重OTP的应用程序,但在这种情况下,特别是因为缺少deps,rebar3将无法知道某些组件没有到位。

However, much like Mix and Rebar3, erlang.mk can publish to hex. 但是,就像Mix和Rebar3一样,erlang.mk可以发布到十六进制。 In doing so, some additional metadata is added to the lib, including dependencies. 在这样做时,一些额外的元数据被添加到lib,包括依赖项。 Other info is still not added (such as compiler options). 其他信息仍未添加(例如编译器选项)。 Overall though, since the library is on hex, and apparently well-formed, rebar3 is able to build it along with its dependencies fine, but only once on hex. 总的来说,由于库是十六进制的,并且显然格式良好,因此rebar3能够将其与依赖关系一起构建,但只能在十六进制上构建一次。

Rebar3 support for git is expected to keep going for the foreseeable future. Rebar3对git的支持预计将在可预见的未来继续发展。 The current release candidate also adds support for many mix dependencies (along with https://github.com/tsloughter/rebar_mix as a plugin), but we currently have no open plans to support erlang.mk projects natively. 当前版本候选版本还增加了对许多混合依赖项的支持(以及https://github.com/tsloughter/rebar_mix作为插件),但我们目前没有开放计划本机支持erlang.mk项目。 Hex and some luck are your best options for this at this point in time. 在这个时间点,Hex和一些运气是你最好的选择。

Is git dead for rebar3? rebar3的git死了吗?

No. It still works and I expect support for it to continue. 不,它仍然有效,我希望它继续得到支持。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么我在 git 推送中收到远程异常? - Why I am getting remote excpetion in git push? 为什么我收到Git的SSL不受支持的协议错误? - Why am I getting an SSL unsupported protocol error for Git? 为什么我在 git 结帐时收到文件丢失的错误消息? - Why am I getting an error that file is missing on git checkout? 为什么在尝试将git与svn一起使用时出现此错误 - Why am I getting this error trying to use git with svn 为什么在 git 工作树中查找顶级目录时会出现“fatal: not a git repository...”? - Why am I getting `fatal: not a git repository...` when looking up toplevel dir in a git worktree? 为什么在 git 拉取或 git 克隆后出现“错误:无效路径‘\’”? - Why I am getting "error: invalid path '\'" after git pull or git clone? Git子模块和钢筋 - Git submodules and rebar 为什么我在运行 git filter-branch 时出现 pathspec 错误? - Why am I getting pathspec error when I run git filter-branch? 当我运行git archive时,为什么会出现“远程:致命:找不到路径:HEAD”错误? - Why am I getting “remote: fatal: path not found: HEAD” error when I run git archive? 为什么在使用cmd和git bash执行以下命令时得到不同的结果? - Why I am getting different results while executing the following command with cmd and git bash?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM