tsloughter / rebar3_run

Run a release with one simple command
Other
25 stars 16 forks source link

Make -related warning #2 #13

Closed paulo-ferraz-oliveira closed 2 years ago

paulo-ferraz-oliveira commented 3 years ago

If you run make with strict enough options you get

Makefile:62: warning: undefined variable 'V'
Makefile:62: warning: undefined variable 'c_verbose_'
Makefile:62: warning: undefined variable 'CPPFLAGS'
Makefile:59: warning: undefined variable 'V'
Makefile:59: warning: undefined variable 'link_verbose_'

I'm not sure any of those is on purpose (they can be silenced with ?=, I guess) but am willing to fix if you let me know what we want here.


Note: this does not exit. It's just a warning, even if avoidable.

paulo-ferraz-oliveira commented 2 years ago

Hi, @tsloughter.

I'm playing around with rebar3_run on my MacBook Air M1. I've made it work, locally, and will pull request as soon as I've worked out all the other quirks.

This is happening, though, and maybe you can point me in the right direction...

I can only get it to work with

EXTRA_DIST_ARGS="-start_epmd false -erl_epmd_port=4370" rebar3 run

I've fiddled around with the .c code, rebar3 generated scripts and this is as far as I got. I know you know stuff around EPMD, which is why I'm asking for your help on this. Does this ring a bell? I'll try to find time to look further into it. Without does arg.s the shell never "shows up" and the boot is just "stuck", like so

===> Analyzing applications...
===> Compiling rebar3_run
===> Verifying dependencies...
===> Analyzing applications...
===> Compiling myapp
===> Assembling release myapp-0.1.0...
===> Release successfully assembled: _build/default/rel/myapp
Exec: /usr/local/lib/erlang/24.3.3/erts-12.3.1/bin/erlexec -boot /Users/paulo/Downloads/myapp/_build/default/rel/myapp/releases/0.1.0/start -mode embedded -boot_var SYSTEM_LIB_DIR /usr/local/lib/erlang/24.3.3/lib -config /Users/paulo/Downloads/myapp/_build/default/rel/myapp/releases/0.1.0/sys.config -args_file /Users/paulo/Downloads/myapp/_build/default/rel/myapp/releases/0.1.0/vm.args -- console
Root: /Users/paulo/Downloads/myapp/_build/default/rel/myapp
/Users/paulo/Downloads/myapp/_build/default/rel/myapp

Thanks much.

Edit: this is Erlang/OTP 24.3 and the latest rebar3 and rebar3_run.

paulo-ferraz-oliveira commented 2 years ago

vm.args seems to have influence in how this works.

With a simple

-sname myapp

rebar3 run "returns"

...
===> Release successfully assembled: _build/default/rel/myapp
Error spawning "/usr/local/lib/erlang/24.3.3/erts-12.3.1/bin/epmd" -daemon (error 10)

With vm.args as

-name myapp@127.0.0.1

we get into the "stuck" situation.

paulo-ferraz-oliveira commented 2 years ago

Another way I got this to run as rebar3 run simply was to have

  1. -start_epmd false in vm.args (no erl_epmd_port present) - Edit: equivalent to START_EPMD=false rebar3 run,
  2. start EPMD by hand and execute rebar3 run.

I'm sure there's a combination that I'm missing, or otherwise we have to start caring about EPMD in the plugin.

paulo-ferraz-oliveira commented 2 years ago

On the other hand

ERL_DIST_PORT=6379 rebar3 run

seems to always bring up the console (as before) with or without epmd running.