What exactly makes tdb2 hard to package (ccan?)

Andrew Bartlett abartlet at samba.org
Mon Apr 9 05:20:53 MDT 2012

On Mon, 2012-04-09 at 11:13 +0200, Jelmer Vernooij wrote:
> Am 09/04/12 08:59, schrieb Andrew Bartlett:
> > On Thu, 2012-04-05 at 16:08 +1000, Andrew Bartlett wrote:
> >> I've been told that the issues with bundled ccan libs are still causing
> >> issues for distributors, so I've come up with a patch that I think
> >> should help.  I'm doing this so we can separate these issues from any
> >> other discussion around tdb2, as I think there are technical build
> >> system issues we can address.
> >>
> >> These patches re-introduce the private library extension (-samba4, -ldb,
> >> etc), but only for ccan.  This is on the basis (which I need to confirm)
> >> that ccan has no static data that would cause an issue if duplicated.
> >> Libraries with important static data like talloc are not renamed, and
> >> will deliberately cause a library conflict as pre previous behaviour. 
> >>
> >> (BTW, Linux distributors should not bundle or distribute libreplace, but
> >> instead depend on libbsd). 
> >>
> >> Please let me know if this helps.  The patches are attached, and in
> >> https://git.samba.org/abartlet/samba.git/?p=abartlet/samba.git/.git;a=shortlog;h=refs/heads/less-ccan-pain
> > In order to test this, I added a mode to autobuild that tries to build
> > 'distribution style' Samba, that is based on 'system libraries' (in a
> > private prefix in this case). 
> >
> > This should be in master soon, and should help us avoid regressions that
> > have often hit distributors and OpenChange.  This patch uses tdb1, as
> > this is what all distributors use, so it is an important use case to
> > test.
> >
> > Then, I've then applied the attached patch to test building with tdb2,
> > which I was expecting to fail.  It still passes, without any of the work
> > I mention above.  
> >
> > So, I'm a little stumped.  Can someone describe the 'linux distribution
> > packaging' failure mode here? (preferably in the form of a patch, so I
> > can reliable test it)?
> The main issue with tdb2 has been that it caused various kinds of
> trouble - various missing symbol errors, concerns about duplicate symbols.
> If I try to build Samba4 without --disable-tdb2 here, I get:
> default/source3/libsmb/smb_share_modes_12.o: In function `smb_name_hash':
> /home/jelmer/src/samba/bin/../source3/libsmb/smb_share_modes.c:320:
> undefined reference to `hash_any'
> collect2: ld gab 1 als Ende-Status zurück
> (My ldb wasn't built against tdb2)
> There have been various errors like this in the past; I've fixed a
> couple, but presumably there are still some left. I suspect this is due
> to the fact that waf thinks that ldb already includes ccan, so it no
> longer has to build or link against it itself.

Thanks.  I'll test with that and see what I get, hopefully it's just a
missing dependency from smb_share_modes to whatever provides hash_any,

> Even if I did have a ldb linked against tdb2 then this would be a
> problem, since ccan doesn't have a stable ABI. So that symbol may not
> actually exist (anymore).

Certainly.  As ccan stands each user project would need to link against
it's own copy.  I don't think waf expects ldb to provide ccan - indeed,
I think that was why I was renaming the lib, to ensure it didn't see it
that way. 

> Related to this (though not specific to packaging) is that ccan seems to
> duplicate a fair bit of code that is already present elsewhere in Samba
> (e.g. lib/util, lib/replace, test infrastructure). There is also a cost
> to maintaining both tdb1 and tdb2 in the tree and supporting them both,
> as we discussed on IRC.
> Readding the suffix doesn't seem like a proper solution to me - it means
> we still end up with three copies of ccan on each system with samba4 on
> it. That doesn't seem to necessarily be better than building it as a
> built-in library. 

If the builtin library works, then that's great.  I was under the
(incorrect?) impression that there were issues making this a builtin,
rather than a private library.  

I don't have a good solution on how to handle the triplicate issue - I
was just trying to get a hold on any of the build issues. 

> This doesn't just apply to ccan btw, but also to
> tdb_compat.


Andrew Bartlett

Andrew Bartlett                                http://samba.org/~abartlet/
Authentication Developer, Samba Team           http://samba.org

More information about the samba-technical mailing list