processone / ejabberd

Robust, Ubiquitous and Massively Scalable Messaging Platform (XMPP, MQTT, SIP Server)
https://www.process-one.net/ejabberd/
Other
6.12k stars 1.51k forks source link

rebar3 compile fails (with partial solution) and normal rebar compile error #1775

Closed v-kat closed 7 years ago

v-kat commented 7 years ago

What version of ejabberd are you using?

17.3 from hex

What operating system (version) are you using?

Mac

How did you install ejabberd (source, package, distribution)?

source

What did not work as expected? Are there error messages in the log? What was the unexpected behavior? What was the expected result?

Compiling with rebar fails. I'd PR fixing module numbers, but you can just update some of the modules on hex.pm, one of your other modules is also failing to compile.

$rebar3 compile
===> Compiling cache_tab
===> Compiling _build/default/lib/cache_tab/src/cache_tab_app.erl failed
_build/default/lib/cache_tab/src/cache_tab_app.erl:33: can't find include file "ets_cache.hrl"
_build/default/lib/cache_tab/src/cache_tab_app.erl:88: undefined macro 'DEFAULT_MAX_SIZE'

_build/default/lib/cache_tab/src/cache_tab_app.erl:61: function init_ets_cache_options/0 undefined

I changed _build/default/lib/cache_tab/src/cache_tab_app.erl.33 to be the contents of the included module, as the .hrl file doesn't seem to be included in the module.

i.e.

 -include("ets_cache.erl").

to (the file's contents)

-define(DEFAULT_MAX_SIZE, infinity).
-define(DEFAULT_LIFE_TIME, infinity).
-define(DEFAULT_CACHE_MISSED, true).

It seemed to have then compiled but I received

sh: ./configure: No such file or directory
===> Hook for compile failed!

To get it to this state, I had to fix various dependencies, as some modules haven't been updated on hex.pm

(below is rebar.config)

{deps, [{lager, ".*", {git, "https://github.com/erlang-lager/lager", {tag, "3.4.2"}}},
        {p1_utils, ".*", {git, "https://github.com/processone/p1_utils", {tag, "1.0.9"}}},
        {cache_tab, ".*", {git, "https://github.com/processone/cache_tab", {tag, "1.0.8"}}},
        {fast_tls, ".*", {git, "https://github.com/processone/fast_tls", {tag, "1.0.11"}}},
        {stringprep, ".*", {git, "https://github.com/processone/stringprep", {tag, "1.0.8"}}},
        {fast_xml, ".*", {git, "https://github.com/processone/fast_xml", {tag, "1.1.22"}}},
        {xmpp, ".*", {git, "https://github.com/processone/xmpp", {tag, "1.1.9"}}},
        {fast_yaml, ".*", {git, "https://github.com/processone/fast_yaml", {tag, "1.0.9"}}},
        {jiffy, ".*", {git, "https://github.com/davisp/jiffy", {tag, "0.14.11"}}},
        {p1_oauth2, ".*", {git, "https://github.com/processone/p1_oauth2", {tag, "0.6.1"}}},
        {luerl, ".*", {git, "https://github.com/rvirding/luerl", {tag, "0.3.0"}}},
rebar 3.4.1 on Erlang/OTP 19 Erts 8.3

This relates to me trying to work around the issues I was experiencing with mix compile https://github.com/processone/ejabberd/issues/1774 with that issue being more important to me.

I can also PR my changes if you don't want to update the hex modules and if you aren't going to do changes to https://github.com/processone/cache_tab

Thanks!

v-kat commented 7 years ago

Rebar also seems to have some dependency issue (on both Ubuntu and Mac)

$rebar compile
Uncaught error in rebar_core: {'EXIT',
                               {function_clause,
                                [{override_deps_versions,
                                  '-update_deps/1-fun-0-',
                                  [{goldrush,"0.1.9"}],
                                  [{file,
                                    "/home/ejabberd/ejabberd/plugins/override_deps_versions.erl"},
                                   {line,14}]},
                                 {lists,map,2,
                                  [{file,"lists.erl"},{line,1239}]},
                                 {override_deps_versions,update_deps,1,
                                  [{file,
                                    "/home/ejabberd/ejabberd/plugins/override_deps_versions.erl"},
                                   {line,14}]},
                                 {rebar_core,acc_modules,5,
                                  [{file,"src/rebar_core.erl"},{line,540}]},
                                 {rebar_core,process_dir1,7,
                                  [{file,"src/rebar_core.erl"},{line,247}]},
                                 {rebar_core,process_each,5,
                                  [{file,"src/rebar_core.erl"},{line,351}]},
                                 {rebar_core,process_dir1,7,
                                  [{file,"src/rebar_core.erl"},{line,253}]},
                                 {rebar_core,process_commands,2,
                                  [{file,"src/rebar_core.erl"},{line,93}]}]}}
zinid commented 7 years ago

I don't think you can compile ejabberd using rebar3.

v-kat commented 7 years ago

I managed to get it to compile successfully and was trying to get mix compile working, as they are more similar in their build output.

Newer versions of some packages need to be pushed for the rebar.config to be right, as well.

zinid commented 7 years ago

So? We're not going to use rebar3 any time soon, because it brings no benefits for our building process.

lock[bot] commented 5 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.