Is libbsd worth the pain?
jelmer at samba.org
Fri Feb 3 06:21:09 MST 2012
-----BEGIN PGP SIGNED MESSAGE-----
On 02/03/2012 04:28 AM, Andrew Bartlett wrote:
> Regarding the recently introduced dependency on libbsd, I am wondering
> if optionally depending on another unix portability lib is really worth
> the pain.
(for those reading along, it's not a hard dependency but a soft
dependency.. only used when libbsd is present)
> The issue I have with libbsd is that we gain so little from using it -
> we cannot depend on it strictly existing, so we must provide our own
> replacement functions anyway, and we need extra code to optionally use
This is true for pretty much everything in libreplace. MD5Init is
apparently part of libc on OpenBSD (and that's why it's in libbsd), so
we would hit issues on OpenBSD anyway (but apparently nobody builds
Samba4 with gdb installed on OpenBSD).
> In any case, we have an issue:
> $ make quicktest
> WAF_MAKE=1 ./buildtools/bin/waf test --quick
> [3935/3962] symbol duplicate checking:
> Waf: Leaving directory `/data/samba-2/bin'
> Build failed:
> Symbol MD5Init linked in multiple libraries ['samba-util',
> make: *** [quicktest] Error 1
> Because libbsd also implements MD5Init (et al), we now have a symbol
> conflict. (Other projects which implement MD5Init internally may not
> have noticed this, as our symbol checking is a samba-only thing).
> A partial patch to fix the MD5 issue is attached, but the configure
> check to find bsd/md5.h needs to be written, and the result all tested
> to ensure that we never use the wrong md5.h.
> All this leads me to the question:
> That we can then have an empty libreplace is neat, but I wonder if it is
> really worth it to avoid having a local copy of strlcat and strlcpy?
The alternative is that I ship it as a patch for Debian/Ubuntu (I don't
really want to ship a libreplace0 package with just two trivial
functions in it), but that just moves the problem and means I have to
deal with conflicts further down the line.
I agree there is some sort of cost/benefit balance here. If we hit too
many issues I'm happy to talk about dropping this optional dependency.
The MD5Init name clash seems like a genuine issue though.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
-----END PGP SIGNATURE-----
More information about the samba-technical