[PATCH] Fix the samba3 dependency hell

Andrew Bartlett abartlet at samba.org
Thu Nov 24 07:10:29 UTC 2016


On Thu, 2016-11-24 at 07:52 +0100, Andreas Schneider wrote:
> On Wednesday, 23 November 2016 21:52:21 CET Michael Adam wrote:
> > 
> > On 2016-11-22 at 17:36 +0100, Andreas Schneider wrote:
> > > 
> > > On Tuesday, 22 November 2016 14:20:00 CET Andreas Schneider
> > > wrote:
> > > > 
> > > > Hello,
> > > > 
> > > > last week I sent a patch to fix an issue with newer versions of
> > > > the gold
> > > > linker complaining about our circular dependencies.
> > > > 
> > > > This patch did not work on Ubuntu. It looks like I produces an
> > > > issue
> > > > with
> > > > the Kerberos library. On Ubuntu 14.04 we link against openldap2
> > > > libaries
> > > > which link against Kerberos libraries. So when we link smbd we
> > > > link
> > > > against
> > > > two Kerberos libaries, yay!
> > > > 
> > > > 
> > > > However I needed a different approach to fix the circular
> > > > dependencies.
> > > > Yes, we have two of them:
> > > > 
> > > > param => smbconf
> > > > smbconf => param
> > > > 
> > > > and
> > > > 
> > > > smbconf => smbregistry
> > > > smbregistry => smbconf
> > 
> > There are more, just not so simple ones.
> > I'll post a patchset that resolves another
> > circular dep which I fixed 3 years ago.
> > Just found the patch again. ;-)
> > 
> > > 
> > > > 
> > > > I've tried to change smbconf first to only consume samba-
> > > > hostconfig, but
> > > > this didn't work. Decoupling param from smbconf is also not
> > > > possible. So
> > > > thinking about this mess there was only one solution.
> > > > 
> > > > As smbconf is a public library, param a subsystem and
> > > > smbregistry a
> > > > library
> > > > the correct thing to do is to push everything in smbconf
> > > > library.
> > > > 
> > > > That's what I did. So everything links against smbconf now.
> > > > 
> > > > 
> > > > Please review the attached patchset and push if you're ok.
> > > > 
> > > > 
> > > > 
> > > > Thanks,
> > > > 
> > > > 	Andreas
> > > 
> > > Updated patchset
> > 
> > What is the update about? :-)
> > (Sure I could diff the patchset files... ;-)
> 
> One additional small patch (the last one) and commit message updates.
> 
> > 
> > No final review yet, but a few initial thoughts:
> > 
> > - Why the 55 reformatting patches?
> >   This kind of contradicts the samba guidelines
> >   of only reformatting the contexts that we touch
> >   with the actual changes.
> 
> a) There is no real formatting in that file
> b) It makes it later easier to see what a patch actually changes. If
> you have
>    everything in one line and remove one or two dependencies it is
> really hard
>    to spot that. The motivation was to make reviewing real patches
> much 
>    simpler.

Moving things to one-thing-per-line sounds good. 

> > 
> > - Regarding the actual dependency changes, I would
> >   like to think about this a little more, as I was
> >   on it some time ago but got distracted. I assume
> >   though that your approach is correct at least
> >   for the short term.
> 
> I tried to remove the param dependency from smbconf, and only use
> samba-
> hostconfig but failed at lp_clustering() also other dependencies
> like 
> samba3util or samba3-util require param.
> 
> Then I tried it the other way around move smbconf stuff from param
> into it's 
> own library. This also doesn't work ...
> 
> 
> The long term goal should be to remove the param/smbconf dependency
> from most 
> of the things. We need something more lightweight we pass down the
> stack.

An easy option might be the lib/param loadparm system.  This sounds
counter-intuitive, but because it doesn't depend on param, but you can
plug in the source3 param code in, you break the dependency loop. 

The main loop, as I recall it, is from source3/param <-> smbregistry
and everything that depends on.  Making the registry code consume a
loadparm context, which is initialised at runtime with the source3
param code, should help.

> > 
> > - The smaller dep-change patches are definitely ok.
> > 
> > Will follow up ...
> 
> Please call and lets talk about it on the phone :)
> 
> 
> 	Andreas
> 
-- 
Andrew Bartlett                       http://samba.org/~abartlet/
Authentication Developer, Samba Team  http://samba.org
Samba Developer, Catalyst IT          http://catalyst.net.nz/services/samba




More information about the samba-technical mailing list