otp icon indicating copy to clipboard operation
otp copied to clipboard

Reimplement escript archives

Open lucioleKi opened this issue 11 months ago • 2 comments

The support for zip archives for packaging Erlang applications is an experimental features, and as such can be subject to incompatible changes.

The support for archives in the code server and the erl_prim_loader module complicates the implementation and make code loading slower even when no archives are used. Furthermore, the existence of the feature prevents or vatstly complicates further optimization of code loading.

Therefore, this commit removes the support for code archives from the code server, and from the code and erl_prim_loader modules.

Having multiple BEAM files and other files in an escript is still supported, but in an incompatible way for escripts created by Erlang/OTP 28. We decided to do it like this to keep escript:create/2 and escript:extract/2 as simple as possible, and make it possible to phase out the old archive format as soon as possible.

However, escripts created by Erlang/OTP 27 and earlier will run in Erlang/OTP 28, provided that they don't rely on archive features in the code server or erl_prim_loader.

lucioleKi avatar Feb 04 '25 13:02 lucioleKi

CT Test Results

    8 files    303 suites   3h 5m 21s ⏱️ 5 263 tests 4 623 ✅ 638 💤 2 ❌ 6 676 runs  5 937 ✅ 736 💤 3 ❌

For more details on these failures, see this check.

Results for commit 96497af5.

:recycle: This comment has been updated with latest results.

To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass.

See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally.

Artifacts

// Erlang/OTP Github Action Bot

github-actions[bot] avatar Feb 04 '25 13:02 github-actions[bot]

This is beautiful! 😍

Although not related to this issue, but for completeness, I have one last to do in relation to the erl_prim_loader and archives which is to remove the Paths variable from its state and keep it in the init module. We were used to rely on these Paths in the past in the code_server (which actually led to bugs) but now they are exclusively managed and used by init. Once archives are gone, it should be easier to refactor this too!

josevalim avatar Feb 05 '25 08:02 josevalim