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

Don't compiles spec for xmpp #13

Closed loguntsov closed 7 years ago

loguntsov commented 7 years ago

I tries compile xmpp_codec.spec manually. So i just changed this file to add one new empty line. After that i ran: make spec And got:

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',
                                            {{badmap,
                                              {dict,1,16,16,8,80,48,
                                               {[],[],[],[],[],[],[],[],[],[],
                                                [],[],[],[],[],[]},
                                               {{[],[],[],[],[],[],[],[],[],
                                                 [[{opaque,xmlel,[]}|
                                                   {{fxml,1,2,[]},type}]],
                                                 [],[],[],[],[],[]}}}},
                                             [{maps,filter,
                                               [#Fun<erl_types.11.61440706>,
                                                {dict,1,16,16,8,80,48,
                                                 {[],[],[],[],[],[],[],[],[],
                                                  [],[],[],[],[],[],[]},
                                                 {{[],[],[],[],[],[],[],[],[],
                                                   [[{opaque,xmlel,[]}|
                                                     {{fxml,1,2,[]},type}]],
                                                   [],[],[],[],[],[]}}}],
                                               [{file,"maps.erl"},{line,205}]},
                                              {erl_types,
                                               t_opaque_from_records,1,
                                               [{file,"erl_types.erl"},
                                                {line,770}]},
                                              {fxml_gen,t_remote,2,
                                               [{file,"src/fxml_gen.erl"},
                                                {line,2744}]},
                                              {fxml_gen,get_label_type,5,
                                               [{file,"src/fxml_gen.erl"},
                                                {line,2192}]},
                                              {fxml_gen,
                                               '-get_types/3-fun-0-',5,
                                               [{file,"src/fxml_gen.erl"},
                                                {line,2160}]},
                                              {lists,map,2,
                                               [{file,"lists.erl"},
                                                {line,1239}]},
                                              {fxml_gen,
                                               '-get_types/3-fun-1-',5,
                                               [{file,"src/fxml_gen.erl"},
                                                {line,2158}]},
                                              {lists,foldl,3,
                                               [{file,"lists.erl"},
                                                {line,1263}]}]}}

Erlang is: Erlang/OTP 19 [erts-8.3] [source-d5c06c6] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false]

What is wrong ?

zinid commented 7 years ago

Gosh, seems like they changed erl_types API again in 19.3... I will take a look ASAP.

loguntsov commented 7 years ago

Hi. What progress for this ? How i can help you to fix this bug ?

zinid commented 7 years ago

I'm a bit busy on another tasks. If you absolutely need to compile the spec, you can install 19.2 and compile it there. The generated code will work in 19.3 anyway.

zhangcunxiang commented 7 years ago

do you have spare time to this task ? I also have the bug with erlang 19.3,wish you take some time to fix the bug .

weiss commented 7 years ago

Compiling Erlang 19.2 is easy:

cd /tmp
curl -LO http://erlang.org/download/otp_src_19.2.tar.gz
tar -xzf otp_src_19.2.tar.gz
cd otp_src_19.2
./configure --without-termcap --disable-hipe --prefix=/opt/erlang-19.2
make
sudo make install
export PATH=/opt/erlang-19.2/bin ;# Before compiling the xmpp spec.

So I don't think this issue is urgent.

loguntsov commented 7 years ago

See my comment: https://github.com/processone/xmpp/issues/9#issuecomment-301870026 to automate building of extensions for xmpp

loguntsov commented 6 years ago

I tried compile specs again for erlang 19.3.5

I made:

$ git clone https://github.com/processone/xmpp.git
$ make
$ make spec

And got this:

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',
                                            {{badmap,
                                              {dict,1,16,16,8,80,48,
                                               {[],[],[],[],[],[],[],[],[],[],
                                                [],[],[],[],[],[]},
                                               {{[],[],[],[],[],[],[],[],[],
                                                 [[{opaque,xmlel,[]}|
                                                   {{fxml,1,2,[]},type}]],
                                                 [],[],[],[],[],[]}}}},
                                             [{maps,filter,
                                               [#Fun<erl_types.11.61440706>,
                                                {dict,1,16,16,8,80,48,
                                                 {[],[],[],[],[],[],[],[],[],
                                                  [],[],[],[],[],[],[]},
                                                 {{[],[],[],[],[],[],[],[],[],
                                                   [[{opaque,xmlel,[]}|
                                                     {{fxml,1,2,[]},type}]],
                                                   [],[],[],[],[],[]}}}],
                                               [{file,"maps.erl"},{line,205}]},
                                              {erl_types,
                                               t_opaque_from_records,1,
                                               [{file,"erl_types.erl"},
                                                {line,770}]},
                                              {fxml_gen,t_remote,2,
                                               [{file,"src/fxml_gen.erl"},
                                                {line,2827}]},
                                              {fxml_gen,get_label_type,5,
                                               [{file,"src/fxml_gen.erl"},
                                                {line,2275}]},
                                              {fxml_gen,
                                               '-get_types/3-fun-0-',5,
                                               [{file,"src/fxml_gen.erl"},
                                                {line,2243}]},
                                              {lists,map,2,
                                               [{file,"lists.erl"},
                                                {line,1239}]},
                                              {fxml_gen,
                                               '-get_types/3-fun-1-',5,
                                               [{file,"src/fxml_gen.erl"},
                                                {line,2241}]},
                                              {lists,foldl,3,
                                               [{file,"lists.erl"},
                                                {line,1263}]}]}}

So isse still not fixed for master. So pls reopen it.

Erlang is:

$erl
Erlang/OTP 19 [erts-8.3.5] [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false]
zinid commented 6 years ago

Works for me on 19.3

loguntsov commented 6 years ago

So how i can localize problem ? any ideas ?

loguntsov commented 6 years ago

Could you use same version of Erlang as me ?

zinid commented 6 years ago

Install newer Erlang? Also, I'm not sure why you constantly recompile the spec: the generated code wouldn't be different.

loguntsov commented 6 years ago

i have my own custom tags so i forced to recompile xmpp every time.

zinid commented 6 years ago

i have my own custom tags so i forced to recompile xmpp every time.

What for? The result will be the same.

zinid commented 6 years ago

It's supposed that you compile your spec only once, then forget about it for several years or so.

loguntsov commented 6 years ago

you uses standard tags from XMPP, but i have my own tags. So i need recompile code every time when i adds new tags for specification.

by the way it works for Erlang/OTP 20 [erts-9.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:10] [hipe] [kernel-poll:false]

zinid commented 6 years ago

So compile it on Erlang 20 and use the generated code on 19.3, what's the problem?

zinid commented 6 years ago

I'm really not going to install all possible Erlang versions to check every minor release (the API breaks even between minor releases) any time soon, I have more important tasks.

loguntsov commented 6 years ago

I used esl-erlang installation named as 19.3.6, don't know why it showed as 19.3.5. Could you check it with this version of erlang ?

zinid commented 6 years ago

We do not recommend using Erlang from Erlang Solutions, there are already 2 other issues detected when using it.

loguntsov commented 6 years ago

Could you point me on some articles for this ? what issues detected ?