erlware / relx

Sane, simple release creation for Erlang
http://erlware.github.io/relx
Apache License 2.0
697 stars 232 forks source link

Fix foreground subcommand with shell/input #786

Closed shino closed 4 years ago

shino commented 4 years ago

Before this PR, foreground subcommand shows shell prompt as console subcommand.

% rebar3 shell
1> relx:build_release(foo, [{release, {foo, "1"}, [kernel,stdlib,sasl]}]).

(default) % _rel/foo/bin/foo foreground
Exec: /home/shino/local/otp/OTP-22.3/erts-10.7/bin/erlexec -noshell -noinput +Bd -boot /home/shino/g/relx/_rel/foo/releases/1/foo -mode interactive -boot_var SYSTEM_LIB_DIR /home/shino/local/otp/OTP-22.3/lib -config /home/shino/g/relx/_rel/foo/releases/1/sys.config -args_file /home/shino/g/relx/_rel/foo/releases/1/vm.args -- foreground
Root: /home/shino/g/relx/_rel/foo
/home/shino/g/relx/_rel/foo
Erlang/OTP 22 [erts-10.7] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1]

Eshell V10.7  (abort with ^G)
(foo@shino-xps)1>

By quoting of FOREGROUNDOPTIONS in extended start script, -noshell -noinput +Bd is treated as single arg instead of three separated args. This PR just removes the quoting. There would be more sophisticated and platform independent ways to resolve the issue, but I don't have much skill about shell script... :sweat_smile: So, other approaches are welcome!

shino commented 4 years ago

Couldn't reproduce ct failure with OTP 22 (22.3 was used on my laptop with arch linux)

tsloughter commented 4 years ago

Thanks! I knew some of these were going to get screwed up, surprised no test caught it though...

tsloughter commented 4 years ago

Ugh, these failures are github's fault. This was happening to me too yesterday, it fails to just checkout the code.

shino commented 4 years ago

Thanks for your review and suggestions! I accepted them and added another commit.