[英]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.