Why is relx not generating a release? - erlang

My relx configuration
{release,{socket,"0.1.0"}}.
{extend_start_script,true}.
My .app file
{application,socket,
[{description,[]},
{vsn,"1"},
{registered,[]},
{applications,[kernel,stdlib,cowboy]},
{mod,{socket,[]}},
{env,[{http_port,8080}]},
{modules,[socket_app,socket_socket_handler,socket_sup]}]}.
After compiling the application using rebar I run relx from my terminal and the following is the output that I get
===> Starting relx build process ...
===> Resolving OTP Applications from directories:
/home/akshat/Desktop/socket/ebin
/home/akshat/Desktop/socket/deps
/usr/lib/erlang/lib
===> Missing beam file hipe <<"/usr/lib/erlang/lib/hipe-3.10.2/ebin/hipe.beam">>
===> Resolving available OTP Releases from directories:
/home/akshat/Desktop/socket/ebin
/home/akshat/Desktop/socket/deps
/usr/lib/erlang/lib
No releases have been specified in the system!
I don't understand this message from relx. Does it not create the release for me?
How do I install hipe?
Update
After doing a fresh install of erlang I no longer get hipe error message. But rebar still says no releases have been specified by the system.

I was having the exact same issue until I enter in the root directory of the rebar3 project, and run the rebar3 compile, rebar3 release commands. It worked perfect.
$ > ls
enter code here
chatx rebar3
$ > cd chatx/
$ > rebar3 compile
===> Verifying dependencies...
===> Compiling chatx
$ > rebar3 release
===> Verifying dependencies...
===> Compiling chatx
===> Starting relx build process ...
===> Resolving OTP Applications from directories:
/Users/studio/erlang/chatx/_build/default/lib
/Users/studio/erlang/chatx/apps
/Users/studio/kerl/20.2/lib
===> Resolved chatx-0.1.0
===> Dev mode enabled, release will be symlinked
===> release successfully created!

Got this working. Re-installing erlang got rid of the first problem i.e the hipe error message. What relx meant by
No releases have been specified by the system
is that I had not specified an application to assemble for release. My understanding was that since I had only one application I would not need to specify it explicitly. So my relx.config file now looks like
{release,{socket,"0.1.0"},[socket]}.
{extend_start_script,true}.
This works and I now have a release in my _rel folder.

Related

Building Atom text editor on Windows fails

I assume we can build Atom on Windows
I followed "Hacking on Atom Core" https://flight-manual.atom.io/hacking-atom/sections/hacking-on-atom-core/#platform-windows
but when I tried to build release 1.59 it failed.
npm ERR! C:\Users\admin\AppData\Local\node-gyp\Cache\15.9.0\include\node\v8.h(28,10): fatal error C1083: Cannot open include file: 'cppgc/common.h': No such file or directory [.\atom_git\atom-1.59-releases\script\node_modules\fs-admin\build\fs_admin.vcxproj]
npm fails to download and install modules.
...
npm WARN old lockfile about: No matching version found for about#1.9.1.
...
I'll really appreciate if somebody can give a reference to Atom build manual.
Thanks.
I had found that build fails when I follow the instructions.
But it builds if I use apm to load modules and build it.

Why cannot I run rebar3 commands in an application generated with rebar3?

I have been trying to generate a rebar3 application, however I have encountered a problem, I have generated new app using rebar3, and when I try to compile it I get error as such:
> ===> Verifying dependencies...
> ===> Uncaught error in rebar_core.
The same error is given when I try to use rebar3 shell. However I can use command rebar3 shell in every other directory including sub directories of the generated application.
rebar3 version returns:
rebar 3.14.0-rc1+build.4613.reffb58aa1f on Erlang/OTP 22 Erts 10.6
I ahve no idea what might cause the error and will be thankfull for any suggestions.
Try do rebar clean and remove _build folder in your application, then try run rebar compile
Couple of ideas.
Try setting DEBUG and run your rebar3 command, i.e. export DEBUG=1.
You are running a release candidate for a new rebar3 version, maybe try the latest 3.13.X version.

Rebar3 release does not run and crash with cannot expand $ERTS_LIB_DIR in bootfile

Erlang Version = Erlang/OTP 19
I have created a new erlang application using rebar3
Here are the steps:
rebar3 new app myapp
rebar3 compile
rebar3 new release myrel
cd myrel
rebar3 release
cd myrel/myapp/_build/default/rel/myapp/bin
./myapp start
I get the following error:
init terminating in do_boot (cannot expand $ERTS_LIB_DIR in bootfile)
Crash dump is being written to: erl_crash.dump...done
Can someone please check what I am missing here?
Thanks.
If you do something like rebar3 as prod tar you should get a .tar.gz file that can be expanded on the server, with bin/myapp used to start/stop/attach. If you do something like rebar3 release, it'll build into _build/, with the start/stop script being in _build/default/rel/myapp/bin/myapp. Why are you using rebar3 new release myrel?

how to setup cowboy with rebar3

I am a newbie of erlang/cowboy, using rebar3 now, as 99's cowboy is using its own erlang.mk system, how can I use rebar3 to build a cowboy release? Thank you in advance.
Use the new command to create your project.
$ rebar3 new app yourapp
Then in your project path find rebar.config file and add cowboy as dependencie under the deps key:
{deps,
[{cowboy, {git, "git://github.com/ninenines/cowboy.git", {tag, "1.0.1"}}}]}.
Then using compile command rebar3 fetch defined dependencies and compile them as well as your application.
rebar3 compile
At the end for making a release you first need to create your release structure and then making a release with following commands.
$ rebar3 new release yourrel
$ rebar3 release
Note that basic usage example of Rebar3 is about cowboy in details.

Systools aborted when generating upgrade with rebar

I wanted to use rebar to release and upgrade my app in windows 7 and my erlang version is R15B. Following the wiki of rebar, I had already released a version. However, I came across a problem in doing upgrade. When I after typing this command:
rebar generate-upgrade previous_release=exemplar_1
it showed me this error:
ERROR: Systools [systools:make_tar/2] aborted with: [{error_add_appl,
{hipe,
{tar_error,
{add,
"f:/exemplar/rel/exemplar_1/lib/hipe-3.9/ebin/hipe.beam",
{"f:/exemplar/rel/exemplar_1/lib/hipe-3.9/ebin/hipe.beam",
enoent}}}}}]
ERROR: 'generate-upgrade' failed while processing f:/exemplar/rel: rebar_abort
Before typing this command, I replaced {start_phases, undefined} entry with {start_phases,[]} in all .app files.
I can't find anything helpful in google, so I ask for help here.

Resources