Skip to content

Commit

Permalink
Adding cross-compilation profile
Browse files Browse the repository at this point in the history
The cross-compilation profile works on a simple basis:

- the target system where the code will run has a pre-built Erlang
  runtime installed with SSL/TLS support (eg. `sudo apt-get install
  erlang-nox` for a wx-free Erlang on a debian or ubuntu host) only
- the host where the build is made has a compatible erlang version used
- the build host calls `rebar3 as portable do release, tar`
- the tarball at `_build/portable/rel/revault/revault-$VSN.tar.gz` is
  moved to the target host
- the target host unpacks the tarball with `tar -xvf revault-$VSN.tar.gz`
- the target host gets the proper TOML configuration and file layout
- the target host calls ./bin/revault console

The target host then runs the software and is possible to contact for
sync jobs.

This is not the same as a fully portable build that would be
self-contained, but it is much simpler to put in place than having to
set up a whole build environment for each target system, and will work
so long as none of the non-system libraries used require NIFs.
  • Loading branch information
ferd committed Dec 15, 2023
1 parent e723169 commit bd764e9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,16 @@
{escript_name, revault_cli},
{escript_emu_args, "%%! -name cli -setcookie revault_cookie +sbtu +A1\n"}
]},
{portable, [
%% meant to be run on a pre-built Erlang system on any supported OS
{relx, [
{include_src, false},
{debug_info, keep},
{dev_mode, false},
{include_erts, false},
{system_libs, false}
]}
]},
{debug, [
%% generate debug traces in gen_* processes
{erl_opts, [{d, 'TEST'}]}
Expand Down

0 comments on commit bd764e9

Please sign in to comment.