processone / xmpp

Erlang/Elixir XMPP parsing and serialization library on top of Fast XML
http://process-one.net
Apache License 2.0
137 stars 88 forks source link

make spec fails with Erlang/OTP 24 #57

Closed badlop closed 3 years ago

badlop commented 3 years ago

"make specs" works perfectly when using 23.2, but just after switching to 24.0, it fails with:

erl -noinput +B -pa ebin -pa deps/*/ebin -eval \
'case fxml_gen:compile("specs/xmpp_codec.spec", [{add_type_specs, xmpp_element}, {erl_dir, "src"}, {hrl_dir, "include"}]) of ok -> halt(0); _ -> halt(1) end.'
failed to compile "specs/xmpp_codec.spec": {'EXIT',
                                            {function_clause,
                                             [{erl_types,initial_typenames,
                                               [{type,{mod,foo,1}}],
                                               [{file,"erl_types.erl"},
                                                {line,4584}]},
                                              {erl_types,t_from_form1,6,
                                               [{file,"erl_types.erl"},
                                                {line,4564}]},
                                              {fxml_gen,t_from_form,1,
                                               [{file,"src/fxml_gen.erl"},
                                                {line,4167}]},
                                              {fxml_gen,get_fun_return_type,
                                               3,
                                               [{file,"src/fxml_gen.erl"},
                                                {line,3511}]},
                                              {fxml_gen,prepare_default,4,
                                               [{file,"src/fxml_gen.erl"},
                                                {line,3765}]},
                                              {fxml_gen,prepare_cdata,5,
                                               [{file,"src/fxml_gen.erl"},
                                                {line,3809}]},
                                              {fxml_gen,prepare_elem,6,
                                               [{file,"src/fxml_gen.erl"},
                                                {line,3727}]},
                                              {fxml_gen,'-compile/4-fun-4-',
                                               6,
                                               [{file,"src/fxml_gen.erl"},
                                                {line,336}]}]}}
make: *** [Makefile:28: spec] Error 1
badlop commented 3 years ago

This is in fact caused by fast_xml: it calls dialyzer's erl_type.erl, which has a breaking change in Erlang//OTP 24.