We ship software in releases. When we ship a new release it may be installed as a fresh system or applied to one which is already in production. The sasl application provides tools for runtime release handling.
We can use release_handler:install_release/1
to upgrade a running system, which leverages the power of hot code loading. The release package has to have first been unpacked with release_handler:unpack_release/1
. A release package may be prepared for shipping using systools:make_tar/1,2
.
Now here’s where things get circular. Installing the release requires a release upgrade file (relup), however no such file is included in the package. We can create relup
with systools:make_relup/3,4
, however it requires an application upgrade file (appup) for each application included and those also are not included in the package.
The appup
file allows us to specify application versions with a regular expression however the relup
file does not. We could just create the relup
in day 1 and add it to the shipped package (erl_tar:add/3,4
), however in order to support upgrading from an arbitrary one of the many previous releases we have to include a relup
clause for every single one. If we have relup
created in day 2, on the target system, we have to arrange for all the appup
files to be created too, which is probably less trouble.
So my question is, which approach were the OTP team expecting us to follow? How are other people dealing with it? I’ve never used rebar
, is it opinionated on this? Would it be difficult to support regular expressions in relup
? Should appup
files be automatically included in packages?