Attempted builds without and with -DMAKE_JOBS_UNSAFE=yes results in the following error:
src/ejabberd_auth_sql.erl:253: unknown type specifier 'l'
src/ejabberd_auth_sql.erl:35: function which_users_exists/2 undefined
Compiling src/ejabberd_auth_sql.erl failed:
ERROR: compile failed while processing /usr/ports/net-im/ejabberd/work/ejabberd-18.12: rebar_abort
gmake: *** [Makefile:109: deps/.built] Error 1
gmake: Leaving directory '/usr/ports/net-im/ejabberd/work/ejabberd-18.12'
===> Compilation failed unexpectedly.
$ uname -a
FreeBSD ratchet.darlow.co.uk 11.2-RELEASE-p5 FreeBSD 11.2-RELEASE-p5 #0: Tue Nov 27 09:33:52 UTC 2018 email@example.com:/usr/obj/usr/src/sys/GENERIC amd64
(In reply to neil from comment #0)
Could you please confirm that when you're building ejabberd, there is no previous version of ejabberd installed on the host, as that is a known issue in ejabberd, also mentioned in UPDATING entry, 20171230
Yes. That was it!
Can pkg-message mention this, at the next update, please? I'm thinking of those who install from ports manually with the following scenario:
1) They uninstall a working version
2) A new version fails to build
3) They are left without an easy reversion mechanism.
Yes, tools like portmaster can create backup packages for you but it would be better for the package to build in the presence of an existing version.
Created attachment 200556 [details]
net-im/ejabberd update to 18.12.1
(In reply to neil from comment #2)
Thanks for the suggestion, although "pkg-message" won't quite work, as it's output at the end of port build.
I am preparing an update for 18.12.1, so also took a shot at implementing this using pre-everything target. The port seems to build fine, and haven't tested running it yet.
If you have any feedback, please do share. I'm planning to commit it tomorrow if nothing breaking change shows up.
Thanks in advance
A commit references this bug:
Date: Fri Dec 28 15:46:16 UTC 2018
New revision: 488608
- Update to 18.12.1
- Fix portlint warning
- Add a message about known build problem via pre-everything target
when ejabberd is already installed. 
Updated port, as well as added a message about the known issue.
Thanks Ashish. All looks good to me.