rebar

erlang rebar escriptize & nifs

寵の児 提交于 2019-12-05 02:31:12
I can use nif's if I write the escript myself, however when I use rebar escriptize the nif functions cannot be found. I think it is because *.so objects are not getting packed like beam files. Here is an simple example; rebar.config : {deps, [ {'jiffy', "", {git, "https://github.com/davisp/jiffy.git", {branch, master}}} ]}. {escript_incl_apps, [jiffy]}. %% I tried this to see what happens if the so got in there but didn't help {escript_incl_extra, [{"deps/jiffy/priv/jiffy.so", "/path/to/my/proj"}]}. test.erl : -module(test). -export([main/1]). main(_Args) -> jiffy:decode(<<"1">>), ok. rebar

Command 'generate' not understood or not applicable

淺唱寂寞╮ 提交于 2019-12-05 00:50:55
I am trying to run rebar generate to generate a release for an erlang rebar project and getting the following error. Any ideas what I am doing wrong? ./rebar generate Command 'generate' not understood or not applicable I am on OSX with erlang version Erlang R14B03 and below is my rebar.conf {lib_dirs, ["deps"]}. {sub_dirs, ["rel"]}. {deps, [ {folsom, ".*", {git, "git://github.com/boundary/folsom", "master"}} ]}. {require_otp_vsn, "R14|R15"}. {erl_opts, [ fail_on_warning, debug_info, warn_missing_spec ]}. {clean_files, ["*.eunit", "ebin/*.beam", "rel/graphsom"]}. {cover_enabled, true}. {eunit

How set Erlang node name, when run an Erlang application by basho rebar from command line

非 Y 不嫁゛ 提交于 2019-12-04 22:28:23
问题 I have compiled my Erlang application by using basho rebar which makes an stand-alone escript executable file. I run it from command line like: ./myapp myconfig.config My questio is that how can I determine the Erlang node name that run my application. When in my application I run 'node()' command, it returns by default "nonode@nohost" but I want to give my name to that node (e.g. mynode@domain.com), so when I run 'node()' in my application, I like to see 'mynode@domain.com' instead of

When to use erlang application:start or included_applications and a supervisor?

五迷三道 提交于 2019-12-04 11:29:21
I have an Erlang application which has a dependency in its deps directory on another application. From what I understand I can either; a) start my dependent application from my including application by calling application:start(some_other_app) which starts the application and shows it running standalone within Observer. b) include my dependent application in my .app file with {included_applications, [some_other_app]} so that the application is loaded and not started and then start the included application from my own top level supervisor. This again starts the included application and shows

How to handle deps while using rebar to release?

断了今生、忘了曾经 提交于 2019-12-04 11:23:38
I'm using rebar generate to handle release, but when I start the application, the deps I use will not be found.` I can start the application manually using erl -pa ./ebin ./deps/*/ebin -s myapp . I'm wonder how to config rebar.config and reltool.config to handle dependencies? Thanks. In order for reltool to generate a release which includes the dependencies, you will need to add them to reltool.config . I have an application called drill_instructor , which has the following reltool.config . The lines like {app, stdlib, [{incl_cond, include}]}, tell reltool to include that application in the

Erlang start application in production

白昼怎懂夜的黑 提交于 2019-12-04 09:39:56
问题 When I'm testing my erlang application on localhost, I have a script that starts the server that looks like the following: #!/bin/sh PWD="$(pwd)" NAME="$(basename $PWD)" erl -pa "$PWD/ebin" deps/*/ebin -boot start_sasl \ -name devnode@127.0.0.1 \ -s reloader \ -s $NAME \ -setcookie some_random_cookie \ +K true \ +P 65536 This prompts open the Erlang shell and from there I would type something like: application:start(myapp) This is fine for development purposes, but how do I deploy this in

Idiomatic way to ship command line tools written in Erlang

爷,独闯天下 提交于 2019-12-04 02:54:04
The problem Most of the articles and books about Erlang I could find focus on creating long running server-like applications leaving the process of command line tools creation not covered. I have a multi-app rebar3 project consisting of 3 applications: myweb - a cowboy based web service; mycli - a command line tool to prepare assets for myweb ; mylib - a library used by both myweb and mycli , depends on a NIF. As a result of the build I want to get such artifacts: an executable for the web part that is going to serve http requests; an executable command line tool for the assets preparation; a

How set Erlang node name, when run an Erlang application by basho rebar from command line

孤街醉人 提交于 2019-12-03 16:08:08
I have compiled my Erlang application by using basho rebar which makes an stand-alone escript executable file. I run it from command line like: ./myapp myconfig.config My questio is that how can I determine the Erlang node name that run my application. When in my application I run 'node()' command, it returns by default "nonode@nohost" but I want to give my name to that node (e.g. mynode@domain.com), so when I run 'node()' in my application, I like to see 'mynode@domain.com' instead of 'nonode@nohost' I know about "erlang -name 'mynode@domain.com'" but please consider I run the application

Cannot start sample erlang release generated with rebar

女生的网名这么多〃 提交于 2019-12-03 03:20:07
问题 I'm a beginner with rebar and erlang generally. I was trying to create an erlang release with rebar according to this tutorial: http://www.metabrew.com/article/erlang-rebar-tutorial-generating-releases-upgrades and got stuck at the point of running generated release. My system is Ubuntu 11.04 64bit, erlang R14B03, installed from sources. When i'm invoking 'bin/somenode console', I get one of the following errors: Exec: /home/ghik/Inz/somerel/rel/somenode/erts-5.8.4/bin/erlexec -boot /home

Cannot start sample erlang release generated with rebar

我们两清 提交于 2019-12-02 16:52:05
I'm a beginner with rebar and erlang generally. I was trying to create an erlang release with rebar according to this tutorial: http://www.metabrew.com/article/erlang-rebar-tutorial-generating-releases-upgrades and got stuck at the point of running generated release. My system is Ubuntu 11.04 64bit, erlang R14B03, installed from sources. When i'm invoking 'bin/somenode console', I get one of the following errors: Exec: /home/ghik/Inz/somerel/rel/somenode/erts-5.8.4/bin/erlexec -boot /home/ghik/Inz/somerel/rel/somenode/releases/1/somenode -mode embedded -config /home/ghik/Inz/somerel/rel