Erlang 版本的独立脚本?
我正在研究如何从 rebar Erlang 应用程序创建一个独立的脚本。本质上,bootstrap 脚本负责加载和压缩来自 ebin 和 priv 的所有文件到内存中,最后将它们写入独立的文件中。 “钢筋”脚本。
我有点喜欢这种方法,并且我在想是否可以轻松地将相同的概念应用于 Erlang 版本。
- 为 Erlang 版本提供一个独立的脚本有意义吗?
- 这已经存在于某个地方了吗?
- 这个潜在的“release-bootstrap”文件应该做的事情之一是处理应用程序依赖关系等。是否可以重用 Erlang 发行版中已有的内容,而无需重新发明轮子?
- 当尝试为 Erlang 版本实现独立的脚本时,是否有任何需要记住的问题?
I'm looking at the way a self-contained script is created out of the rebar Erlang application. Essentially, a bootstrap script takes care of loading and compressing all files from ebin and priv into memory, to finally write them into the self-contained "rebar" script.
I kinda like the approach and I'm thinking if it would be easily possible the same concept to Erlang releases.
- Would it make sense to have a self-contained script for an Erlang release?
- Does this exist somewhere out there, already?
- One of the things this potential "release-bootstrap" file should do is to take care of application dependencies and so on. Would it be possible to re-use what already exist in the Erlang distribution, without re-inventing the wheel?
- Are there any gotchas to keep in mind, when trying to achieve a self-contained script for an Erlang release?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
查看 escript 文档(escript 模块)。您本质上要做的是将一堆应用程序压缩到目录结构(类似于发布版)中,然后通过将 escript 标头附加到 zip 文件并将其重命名来将该文件转换为 escript。
http://www.erlang.org/doc/man/escript.html
Have a look at the escript docs (escript module). What you essentially do, is zip up a bunch of applications in a directory structure (much as a release) than convert that file to an escript by appending a escript header to the zip file and rename it.
http://www.erlang.org/doc/man/escript.html