Skip to content

"make options" crashes with Erlang/OTP 28.0-rc1 #4352

Closed
@badlop

Description

@badlop

When running "make options" with Erlang/OTP 28.0-rc1, it crashes and shows error message:

escript: exception error: undefined function erl_types:t_opaque_from_records/1
 function  opt_types_sh__escript__1739__876963__702419__1122:t_remote/2 (tools/opt_types.sh, line 458)
  in call from opt_types_sh__escript__1739__876963__702419__1122:type_with_default/3 (tools/opt_types.sh, line 227)
  in call from opt_types_sh__escript__1739__876963__702419__1122:'-map_to_specs/3-fun-0-'/5 (tools/opt_types.sh, line 212)
  in call from maps:fold_1/4 (maps.erl, line 871)
  in call from opt_types_sh__escript__1739__876963__702419__1122:map_to_specs/3 (tools/opt_types.sh, line 210)
  in call from opt_types_sh__escript__1739__876963__702419__1122:main/1 (tools/opt_types.sh, line 18)
make: *** [Makefile:236: options] Error 127

This is because Erlang 28 removed the function erl_types:t_opaque_from_records/1 in commit erlang/otp@5dab31e and that function is called by function t_remote/2 in ejabberd's tools/opt_types.sh

The good news: apparently this is the only missing function, because applying a dummy patch like this removes the error and "make options" finishes correctly:

diff --git a/tools/opt_types.sh b/tools/opt_types.sh
index 5c8761f82..9a8bdf47e 100755
--- a/tools/opt_types.sh
+++ b/tools/opt_types.sh
@@ -452,6 +452,23 @@ t_from_form(Spec) ->
                erl_types:var_table__new(), erl_types:cache__new()),
     T.
 
+t_remote(Mod, acl) ->
+    erl_types:t_any();
+t_remote(Mod, ip4_address) ->
+    erl_types:t_tuple();
+t_remote(Mod, ip6_address) ->
+    erl_types:t_tuple();
+t_remote(Mod, ip_address) ->
+    erl_types:t_tuple();
+t_remote(Mod, jid) ->
+    erl_types:t_tuple();
+t_remote(Mod, re_mp) ->
+    erl_types:t_tuple();
+t_remote(Mod, shaper_rule) ->
+    erl_types:t_tuple();
+t_remote(Mod, uri) ->
+    erl_types:t_tuple();
+
 t_remote(Mod, Type) ->
     D = maps:from_list([{{opaque, Type, []},
                          {{Mod, 1, 2, []}, type}}]),

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions