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

Can't compile xmpp #38

Closed bswstudiosgit closed 5 years ago

bswstudiosgit commented 5 years ago

I followed these steps

`

    git clone https://github.com/processone/xmpp.git

        Cloning into 'xmpp'...
        remote: Enumerating objects: 30, done.
        remote: Counting objects: 100% (30/30), done.
        remote: Compressing objects: 100% (22/22), done.
        remote: Total 1967 (delta 13), reused 18 (delta 8), pack-reused 1937
        Receiving objects: 100% (1967/1967), 1.30 MiB | 19.05 MiB/s, done.
        Resolving deltas: 100% (1469/1469), done.
        [user@ip]$ cd xmpp
         [user@ip xmpp]$ make
         ./rebar get-deps compile
          ==> xmpp (get-deps)
         Pulling p1_utils from {git,"https://github.com/processone/p1_utils",
                       {tag,"1.0.16"}}
         Cloning into 'p1_utils'...
         Pulling fast_xml from {git,"https://github.com/processone/fast_xml",
                       {tag,"1.1.37"}}
         Cloning into 'fast_xml'...
         Pulling fast_tls from {git,"https://github.com/processone/fast_tls",
                       {tag,"1.1.2"}}
         Cloning into 'fast_tls'...
         Pulling ezlib from {git,"https://github.com/processone/ezlib",{tag,"1.0.6"}}
         Cloning into 'ezlib'...
         Pulling stringprep from {git,"https://github.com/processone/stringprep",
                         {tag,"1.0.17"}}
         Cloning into 'stringprep'...
          ==> p1_utils (get-deps)
          ==> fast_xml (get-deps)
          ==> fast_tls (get-deps)
          ==> ezlib (get-deps)
          ==> stringprep (get-deps)
          ==> p1_utils (compile)
          Compiled src/p1_server.erl
          Compiled src/p1_utils.erl
          Compiled src/p1_utils_sup.erl
          Compiled src/treap.erl
          Compiled src/p1_queue.erl
          Compiled src/p1_nif_utils.erl
          Compiled src/p1_file_queue.erl
          Compiled src/p1_shaper.erl
          Compiled src/p1_options.erl
          Compiled src/p1_time_compat.erl
          Compiled src/p1_http.erl
          Compiled src/p1_rand.erl
          Compiled src/p1_edoc_layout.erl
           Compiled src/p1_prof.erl
           Compiled src/p1_fsm.erl
            ==> fast_xml (compile)
          Compiled src/fxml_gen_pt.erl
          Compiled src/fxmlrpc_codec_external.erl
          Compiled src/fxmlrpc.erl
          Compiled src/fxml.erl
          Compiled src/fxml_stream.erl
          Compiled src/fxml_sup.erl
          Compiled src/fast_xml.erl
          Compiled src/fxmlrpc_codec.erl
          Compiled src/fxml_gen.erl
          Compiling c_src/fxml.c
          Compiling c_src/fxml_stream.c
           ==> fast_tls (compile)
           Compiled src/fast_tls_app.erl
           Compiled src/fast_tls_sup.erl
           Compiled src/p1_sha.erl
           Compiled src/fast_tls.erl
          Compiling c_src/fast_tls.c
          Compiling c_src/ioqueue.c
          Compiling c_src/p1_sha.c
          ==> ezlib (compile)
          Compiled src/ezlib_app.erl
          Compiled src/ezlib_sup.erl
          Compiled src/ezlib.erl
          Compiling c_src/ezlib_drv.c
          ==> stringprep (compile)
          Compiled src/stringprep_sup.erl
          Compiled src/stringprep_app.erl
          Compiled src/stringprep.erl
          Compiling c_src/stringprep.cpp
           ==> xmpp (compile)
          Compiled asn1/XmppAddr.asn1
          Compiled src/xmpp_sasl.erl
          Compiled src/xep0249.erl
          Compiled src/xep0355.erl
          Compiled src/xep0405.erl
          Compiled src/xmpp_config.erl
          Compiled src/xep0055.erl
          Compiled src/scram.erl
          Compiled src/xep0115.erl
          Compiled src/xep0280.erl
          Compiled src/xep0377.erl
           Compiled src/xep0114.erl
            Compiled src/pubsub_publish_options.erl
           Compiled src/xep0221.erl
           Compiled src/xep0078.erl
           Compiled src/pubsub_get_pending.erl
           Compiled src/xep0369.erl
           Compiled src/http_upload.erl
            Compiled src/xep0065.erl
            Compiled src/xep0363.erl
             Compiled src/xdata_codec.erl
             Compiled src/jid.erl
             Compiled src/xep0022.erl
              Compiled src/xep0050.erl
              Compiled src/xep0047.erl
               Compiled src/xep0012.erl
               Compiled src/xep0013.erl
                Compiled src/xmpp_util.erl
                Compiled src/xmpp_sasl_digest.erl
                Compiled src/xep0138.erl
                Compiled src/xmpp_codec.erl
                Compiled src/rfc6121.erl
                Compiled src/xep0352.erl
                 Compiled src/xep0049.erl
                Compiled src/xep0045.erl
                 Compiled src/xep0039.erl
                 Compiled src/muc_register.erl
                   src/xmpp_stream_out.erl:49: syntax error before: ':='
                   src/xmpp_stream_out.erl:1388: type state() undefined
                    src/xmpp_stream_out.erl:78: Warning: type stream_state() is unused
                    ERROR: compile failed while processing /home/ec2-user/xmpp: rebar_abort
                    make: *** [src] Error 1_`

I am using erlang-18.0 .

badlop commented 5 years ago

I am using erlang-18.0 .

In the README file I see no mention about what erlang version it requires. But, as you can see, it requires something newer than 18.0 to compile. This library should work with recent ejabberd, which requires Erlang/OTP 19.1.

In conclusion, try installing Erlang 19, or anything newer that you can find, and comment here if it compiles correctly or still fails.

bswstudiosgit commented 5 years ago

Hi @badlop, I switched to erlang-19.0 now. make worked this time . But when I try make spec now I get this error

 `       
             make spec
             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',
                                        {{badrecord,dict},
                                         [{dict,filter_dict,2,
                                           [{file,"dict.erl"},{line,466}]},
                                          {erl_types,
                                           t_opaque_from_records,1,
                                           [{file,"erl_types.erl"},
                                            {line,750}]},
                                          {fxml_gen,t_remote,2,
                                           [{file,"src/fxml_gen.erl"},
                                            {line,2749}]},
                                          {fxml_gen,get_label_type,5,
                                           [{file,"src/fxml_gen.erl"},
                                            {line,2201}]},
                                          {fxml_gen,
                                           '-get_types/3-fun-0-',5,
                                           [{file,"src/fxml_gen.erl"},
                                            {line,2169}]},
                                          {lists,map,2,
                                           [{file,"lists.erl"},
                                            {line,1239}]},
                                          {fxml_gen,
                                           '-get_types/3-fun-1-',5,
                                           [{file,"src/fxml_gen.erl"},
                                            {line,2167}]},
                                          {lists,foldl,3,
                                           [{file,"lists.erl"},
                                            {line,1263}]}]}}
                make: *** [spec] Error 1
`

EDIT I switched again to erlang-20.0. Everything works fine now.

mremond commented 5 years ago

I updated the README to mention about the minimal Erlang version: https://github.com/processone/xmpp/commit/7776a08852b3ea8874f904dbf7d14e0f210999ca