why does samba build system versions all public-lib symbols?

Michael Tokarev mjt at tls.msk.ru
Sat Sep 9 10:57:02 UTC 2023


Hi!

I grumbled on this list before about ABI symbol versioning in samba public libs
already.  Here comes a question, finally: why?

Most often this becomes problematic when back-porting some symbol changes
(usually newly added symbols) from current "mainline" branch to previous
branches, sometimes multiple.

For example, ldb 2.8.0 introduced ldb_msg_add_distinguished_name() and a
few others, while trying to fix an issue.  Current samba (4.19) uses this
symbol.  When built against current ldb 2.8.0, this symbol will be tied
to version 2.8.0.  Okay, so far so good.

This same symbol has been back-ported to previous ldb release, introduced
in 2.7.2 version, and is used by samba 4.18.1.  So when samba 4.18.1+ is
built against ldb-2.7.2 which comes with it, it will be linked to
ldb_msg_add_distinguished_name at LDB_2.7.2, instead of
ldb_msg_add_distinguished_name at LDB_2.8.0, despite the fact this is exactly
the same function.

So when I have, say, samba 4.18.4 installed, I can not upgrade ldb to
version 2.8.0, since this will break samba due to missing symbol of
version 2.7.2.

But it is more: the same symbol ldb_msg_add_distinguished_name has been
back-ported to samba 4.17 too, which comes with ldb-2.6.2.  And there,
it is named ldb_msg_add_distinguished_name at LDB_2.6.2 instead.  Which is
3rd name of the SAME symbol.  And I can't update libldb from 2.6.2 to
neither 2.7.2 nor 2.8.0, since this will obviously break samba.

Right now I have ldb-2.8.0 in debian, with ldb_msg_add_distinguished_name at LDB_2.8.0,
and samba 4.19.0 linked to it.  I can't re-build ldb with added sigs file
from version 2.7.2 or 2.6.2 without recompiling all deps.  So I'm, once
again, in a catch-22 situation, to decide which part to break.

Even if these symbols are only used by samba itself, - based on which I
can have strong versioned (=binary:Version) dependency between samba and
ldb packages, - this is possible because both are now built from the same
source, - but these symbols are still part of public ABI, and other software
*might* (start) using these symbols, and will be broken by each samba
upgrade.

So the question is: why to mark symbols with versions at all, why can't
these be unversioned like almost all other software does?  What good
such versioning serves?

I looked at the build system, - buildtools/wafsamba/samba_abi.py - where
it generates the ld script file. I'm about to drop the whole thing in
there for debian and use manually crafted symbols vile instead, to fix
this whole issue.  But even there I'll have to perform some sort of
transition from versioned to unversioned, or somesuch..

Thanks,

/mjt



More information about the samba-technical mailing list