[debian] building bundled talloc/tevent/tdb libs out of main samba sources
Michael Tokarev
mjt at tls.msk.ru
Wed Nov 27 14:41:28 UTC 2024
27.11.2024 08:26, Andrew Bartlett via samba-technical wrote:
> On Wed, 2024-11-27 at 08:12 +0300, Michael Tokarev via samba-technical
> wrote:
>> 26.11.2024 23:49, Andrew Bartlett via samba-technical wrote:
>>> On Tue, 2024-11-26 at 21:39 +0300, Michael Tokarev via samba-
>>> technical
>>> wrote:
>>>> Hi!
>>>> After a few times dealing with incompatibilities of older
>>>> talloc/tevent/tdblibs with new samba and shipping stuff for
>>>> debian
>>>> backports and other olderdistributions, I decided to give it a
>>>> try:
>>>> to build these 3 bundled libs outof samba source, without using
>>>> separate tarballs (which also lacks githistory).
>>>> The result is rather simple, speaking for the packaging it's
>>>> available at
>>>> https://salsa.debian.org/samba-team/samba/-/merge_requests/64
>>>> - 3
>>>> commitsimporting packaging for tdb, tevent and talloc libs, one
>>>> by
>>>> one.
>>>
>>> I support this idea.
>>>
>>> Rather than needing to patch the wscript files, have you tried:
>>>
>>> --private-library=!tdb
>>> My intention (but I didn't do any testing with the other libraries)
>>> was
>>> to try and have this as generic as possible, pulling any library in
>>> or
>>> out if needed, with only the default position being encoded in the
>>> source, to help with this kind of thing.
>>
>> Unfortunately this option does nothing for this kind of libraries.
>> This is exactly why we had to patch ldb in debian before (when
>> switched to building ldb from samba sources), in exactly the same
>> way as I'm patching tdb/etc now. And this is exactly what you
>> did with ldb too, in de1ab855ee2 "lib/ldb: Always build standalone".
>>
>> Without patching lib/tdb/wscript, it is always built as libsamba-
>> private-tdb.so,
>> with no headers installed.
>>
>> Please note that currently, --private-libraries=!ldb does exactly
>> nothing to the result - ldb is built as a regular public samba
>> library,
>> by default already. --private-libraries=ldb however, disables this
>> "publicity", and builds ldb as libprivate-samba-ldb.so (with no ldb.h
>> installed), - it looks like 4.21.0 WHATSNEWS.txt entry about !ldb is
>> wrong.
And here it is me who's wrong. I did just a lot of rebuilds of the
things trying to figure out the missing rpath thing, and mixed things
up. No, --private-libraries=!ldb is required to produce separate
libldb instead of building it as samba-private-ldb - exactly as stated
in WHATSNEW.txt. I stand corrected, please excuse me for the noise.
> That's how far back the suggestions to do this went. I was involved in
> suggesting this, and encouraged the effort. It took some years to gain
> consensus within the Samba Team on the approach, and then time to implement it in a way I was happy to propose upstream. And yet it seems from the above that for ldb it still has edge cases. Sorry about that.
No, it was an (interpretation) error on my part, -
things seems to be ok wrt libldb.
> That is why I'm suggesting looking at what I did for ldb, and trying to
> make that more general, because we worked on some of those details.
>
> Perhaps try what I suggested and your patch? If you mark the library
> public, it should start to do the right things. I hope.
Take a look at lib/talloc/wscript or other two.
It has direct assignment:
conf.env.standalone_talloc = conf.IN_LAUNCH_DIR()
(which becomes true only if we're not in a subdir like lib/talloc but
in the root dir of the source).
And later, omitting details:
if bld.env.standalone_talloc:
private_library = False
else:
private_library = True
bld.SAMBA_LIBRARY('talloc',
'talloc.c',
deps='replace',
provide_builtin_linking=True,
abi_directory='ABI',
abi_match='talloc* _talloc*',
hide_symbols=True,
vnum=VERSION,
public_headers=('' if private_library else 'talloc.h'),
pc_files='talloc.pc',
public_headers_install=not private_library,
private_library=private_library,
manpages='man/talloc.3')
In short: the code only adds properties for the library
(headers, linking, etc) if the library is being built in
the root of the source tree. At least this is how I read
it. And no amount of tweaking list of private libs down
the road will help without the missing properties.
/mjt
More information about the samba-technical
mailing list