erlware / relx

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

Fix include_erts=false failure with OTP-25.0-rc2 #909

Closed shino closed 2 years ago

shino commented 2 years ago

At OTP 25.0-rc2, the release with setting {include_erts, false} results in error.

(default) % _build/dev/rel/devmode/bin/devmode console
Exec: /home/shino/local/otp/25.0-rc2/erts-13.0/bin/erlexec -boot /home/shino/g/devmode/_build/dev/rel/devmode/releases/0.0.0/start -mode interactive -boot_var SYSTEM_LIB_DIR /home/shino/local/otp/25.0-rc2/lib -config /home/shino/g/devmode/_build/dev/rel/devmode/releases/0.0.0/sys.config -args_file /home/shino/g/devmode/_build/dev/rel/devmode/releases/0.0.0/vm.args -- console
Root: /home/shino/g/devmode/_build/dev/rel/devmode
/home/shino/g/devmode/_build/dev/rel/devmode
Can not find inet_gethost for erts-13.0/x86_64-pc-linux-gnu

Crash dump is being written to: erl_crash.dump...done

cf. Release fails to start when rebar3's include_erts=false is used, 25.0-rc2 · Issue #5826 · erlang/otp https://github.com/erlang/otp/issues/5826

The current relx's release sets ROOTDIR to RELEASE_ROOT_DIR and exports it, and code:root_dir() is set to there. On the other hand, https://github.com/erlang/otp/commit/a32f6d210a58ba1e56f54f07c91106efed2c0777 assumes there exists ROOTDIR/erts-<VSN>/bin/inet_gethost, which is spec conformant acording to the discussion at https://github.com/erlang/otp/issues/5826 .

This PR's changes are as follows:


Because I don't have windows box, this PR might be incomplete. Anyway, I hope this can be the base for discussion.

shino commented 2 years ago

Oops, CI on windows failed... can't debug it...

shino commented 2 years ago

There is another PR to save the situation, https://github.com/erlang/otp/pull/5852 . h/t @garazdawi

shino commented 2 years ago

The original issue https://github.com/erlang/otp/issues/5826 has been solved by Erlang/OTP side https://github.com/erlang/otp/pull/5852 . h/t garazdawi Close this.