Open royrwood opened 2 years ago
@royrwood Just tried building from your PR on ejabberd/ecs:21.12
image. With:
FROM ejabberd/ecs:21.12
RUN sed -i 's/## mod_mam:/mod_mam: {}/g' /home/ejabberd/conf/ejabberd.yml
RUN mkdir -p /home/ejabberd/.ejabberd-modules/mod_unread && \
cd /home/ejabberd/.ejabberd-modules/mod_unread && \
wget https://github.com/binnj/ejabberd-unread/archive/refs/heads/ejabberd-21.12-support.zip
RUN cd /home/ejabberd/.ejabberd-modules/mod_unread && unzip ejabberd-21.12-support.zip
RUN nohup /home/ejabberd/bin/ejabberdctl foreground & > /dev/null && \
sleep 3 && \
/home/ejabberd/bin/ejabberdctl modules_update_specs && \
/home/ejabberd/bin/ejabberdctl module_install ejabberd_auth_http && \
/home/ejabberd/bin/ejabberdctl module_install mod_unread
However build did not succeed. It fails with:
#9 3.781 /home/ejabberd/.ejabberd-modules/sources/ejabberd-contrib/mod_unread/src/hg_unread.erl:6: Warning: export_all flag enabled - all functions will be exported
#9 3.872 /home/ejabberd/.ejabberd-modules/sources/ejabberd-contrib/mod_unread/src/mod_unread.erl:14: can't find include file "ejabberd.hrl"
#9 3.873 /home/ejabberd/.ejabberd-modules/sources/ejabberd-contrib/mod_unread/src/mod_unread.erl:19: can't find include file "hg_unread.hrl"
#9 3.873 /home/ejabberd/.ejabberd-modules/sources/ejabberd-contrib/mod_unread/src/mod_unread.erl:20: can't find include file "mod_unread.hrl"
#9 3.874 /home/ejabberd/.ejabberd-modules/sources/ejabberd-contrib/mod_unread/src/mod_unread.erl:63: undefined macro 'NS_UNREAD'
#9 3.875 /home/ejabberd/.ejabberd-modules/sources/ejabberd-contrib/mod_unread/src/mod_unread.erl:83: undefined macro 'NS_UNREAD'
#9 3.876 /home/ejabberd/.ejabberd-modules/sources/ejabberd-contrib/mod_unread/src/mod_unread.erl:4: function start/2 undefined
#9 3.876 /home/ejabberd/.ejabberd-modules/sources/ejabberd-contrib/mod_unread/src/mod_unread.erl:4: function stop/1 undefined
#9 3.877 /home/ejabberd/.ejabberd-modules/sources/ejabberd-contrib/mod_unread/src/mod_unread.erl:33: record ur_unread_messages undefined
#9 3.878 /home/ejabberd/.ejabberd-modules/sources/ejabberd-contrib/mod_unread/src/mod_unread.erl:35: record ur_unread_message undefined
#9 3.879 /home/ejabberd/.ejabberd-modules/sources/ejabberd-contrib/mod_unread/src/mod_unread.erl:37: record ur_unread undefined
#9 3.880 /home/ejabberd/.ejabberd-modules/sources/ejabberd-contrib/mod_unread/src/mod_unread.erl:42: spec for undefined function start/2
#9 3.881 /home/ejabberd/.ejabberd-modules/sources/ejabberd-contrib/mod_unread/src/mod_unread.erl:71: spec for undefined function stop/1
#9 3.881 /home/ejabberd/.ejabberd-modules/sources/ejabberd-contrib/mod_unread/src/mod_unread.erl:136: record ur_ack undefined
#9 3.882 /home/ejabberd/.ejabberd-modules/sources/ejabberd-contrib/mod_unread/src/mod_unread.erl:137: variable 'ConversationJid' is unbound
#9 3.882 /home/ejabberd/.ejabberd-modules/sources/ejabberd-contrib/mod_unread/src/mod_unread.erl:137: variable 'MessageId' is unbound
#9 3.883 /home/ejabberd/.ejabberd-modules/sources/ejabberd-contrib/mod_unread/src/mod_unread.erl:141: record ur_query undefined
#9 3.884 /home/ejabberd/.ejabberd-modules/sources/ejabberd-contrib/mod_unread/src/mod_unread.erl:149: record ur_query undefined
#9 3.885 /home/ejabberd/.ejabberd-modules/sources/ejabberd-contrib/mod_unread/src/mod_unread.erl:151: variable 'Conversation' is unbound
#9 3.885 /home/ejabberd/.ejabberd-modules/sources/ejabberd-contrib/mod_unread/src/mod_unread.erl:163: field xml_els undefined in record forwarded
#9 3.886 /home/ejabberd/.ejabberd-modules/sources/ejabberd-contrib/mod_unread/src/mod_unread.erl:166: variable 'El' is unbound
#9 3.887 /home/ejabberd/.ejabberd-modules/sources/ejabberd-contrib/mod_unread/src/mod_unread.erl:170: variable 'El' unsafe in 'try' (line 166)
#9 3.887 /home/ejabberd/.ejabberd-modules/sources/ejabberd-contrib/mod_unread/src/mod_unread.erl:174: variable 'El' unsafe in 'try' (line 166)
#9 3.888 /home/ejabberd/.ejabberd-modules/sources/ejabberd-contrib/mod_unread/src/mod_unread.erl:180: variable 'El' unsafe in 'try' (line 166)
#9 3.889 /home/ejabberd/.ejabberd-modules/sources/ejabberd-contrib/mod_unread/src/mod_unread.erl:208: field xml_els undefined in record forwarded
#9 3.889 /home/ejabberd/.ejabberd-modules/sources/ejabberd-contrib/mod_unread/src/mod_unread.erl:3: Warning: undefined callback function mod_doc/0 (behaviour 'gen_mod')
#9 3.890 /home/ejabberd/.ejabberd-modules/sources/ejabberd-contrib/mod_unread/src/mod_unread.erl:3: Warning: undefined callback function mod_options/1 (behaviour 'gen_mod')
#9 3.890 /home/ejabberd/.ejabberd-modules/sources/ejabberd-contrib/mod_unread/src/mod_unread.erl:207: Warning: variable 'NewMessage' is unused
#9 4.076 /home/ejabberd/.ejabberd-modules/sources/ejabberd-contrib/mod_unread/src/mod_unread_sql.erl:7: can't find include file "hg_unread.hrl"
#9 4.077 /home/ejabberd/.ejabberd-modules/sources/ejabberd-contrib/mod_unread/src/mod_unread_sql.erl:8: can't find include file "mod_unread.hrl"
#9 4.077 /home/ejabberd/.ejabberd-modules/sources/ejabberd-contrib/mod_unread/src/mod_unread_sql.erl:9: can't find include file "ejabberd.hrl"
#9 4.077 /home/ejabberd/.ejabberd-modules/sources/ejabberd-contrib/mod_unread/src/mod_unread_sql.erl:20: record ur_unread undefined
#9 4.078 /home/ejabberd/.ejabberd-modules/sources/ejabberd-contrib/mod_unread/src/mod_unread_sql.erl:29: record ur_unread undefined
#9 4.078 /home/ejabberd/.ejabberd-modules/sources/ejabberd-contrib/mod_unread/src/mod_unread_sql.erl:31: record ur_unread undefined
#9 4.079 /home/ejabberd/.ejabberd-modules/sources/ejabberd-contrib/mod_unread/src/mod_unread_sql.erl:71: record ur_unread_messages undefined
#9 4.079 /home/ejabberd/.ejabberd-modules/sources/ejabberd-contrib/mod_unread/src/mod_unread_sql.erl:80: record ur_unread_messages undefined
#9 4.079 /home/ejabberd/.ejabberd-modules/sources/ejabberd-contrib/mod_unread/src/mod_unread_sql.erl:88: record ur_unread_message undefined
#9 4.080 /home/ejabberd/.ejabberd-modules/sources/ejabberd-contrib/mod_unread/src/mod_unread_sql.erl:98: record ur_unread_message undefined
#9 4.080 /home/ejabberd/.ejabberd-modules/sources/ejabberd-contrib/mod_unread/src/mod_unread_sql.erl:3: Warning: behaviour mod_unread undefined
#9 4.081 /home/ejabberd/.ejabberd-modules/sources/ejabberd-contrib/mod_unread/src/mod_unread_sql.erl:81: Warning: variable 'Amount' is unused
#9 4.082 /home/ejabberd/.ejabberd-modules/sources/ejabberd-contrib/mod_unread/src/mod_unread_sql.erl:81: Warning: variable 'Conversation' is unused
#9 4.082 /home/ejabberd/.ejabberd-modules/sources/ejabberd-contrib/mod_unread/src/mod_unread_sql.erl:99: Warning: variable 'MessageId' is unused
#9 4.082 /home/ejabberd/.ejabberd-modules/sources/ejabberd-contrib/mod_unread/src/mod_unread_sql.erl:99: Warning: variable 'User' is unused
#9 4.087 Error: error
#9 4.088 Error: {compilation_failed,"/home/ejabberd/.ejabberd-modules/sources/ejabberd-contrib/mod_unread/src/mod_unread.erl"}
------
executor failed running [/bin/sh -c nohup /home/ejabberd/bin/ejabberdctl foreground & > /dev/null && sleep 3 && /home/ejabberd/bin/ejabberdctl module_install mod_unread]: exit code: 1
ERROR: Service 'ejabberd' failed to build : Build failed
I made some changes to support ejabberd 21.12. Please review and pull or provide feedback.
Thanks for your work on the unread module.