[haiku-development] Re: [haiku-development]

  • From: Niels Sascha Reedijk <niels.reedijk@xxxxxxxxx>
  • To: Haiku Development <haiku-development@xxxxxxxxxxxxx>
  • Date: Fri, 17 Dec 2021 15:08:29 +0000

Hi,

On Fri, Dec 17, 2021 at 2:57 PM Adrien Destugues
<pulkomandy@xxxxxxxxxxxxx> wrote:


I think we are on the same page with this, though I would add caveat
that there may be some cases where we want to extend the legacy C++98
kits with some specific features when it adds value. For me, adding
support for noexcept moves to BString is one of those examples.




The specific case for adding these compatibility constants is for the
BError class. Since this new addition to the API is not specific to
the network kit, I thought it might be good to live in libbe.so. But
it may be too early.

It can be:
1. Stay in libbe.so but be modern C++ only.
2. Stay in libbe.so in the BPrivate namespace as modern C++ only.
3. Move to libnetservices2.a for now
4. Move to libshared.a

The normal process for introducing a new API is:

First put it into the BPrivate namespace, AND in a static library (or make it 
header-only)

This way, apps that use it essentially bundle a copy of it, and being in a 
private namespace (and hidden symbol visibility now) it is isolated from 
other uses and from future updates.

When the API is considered mature, add the needed ABI future-proofing: the 
Perform() method, vtable reserved slots, and reserved fields.

Only then it is safe to move the class to a shared library, and out of the 
BPrivate namespace.

This process is a bit annoying, but everytime we tried to skip steps in it, 
we end up with apps relying on a specific ABI, and this means more work to 
either update these apps, or use even worse hacks to keep the ABI compatible.

So we should make it a general rule that all new APIs are fist distributed as 
a static lib, and moved to a .so only when they are stable. It would save us 
a lot of trouble. Especially for something like BError, if the approach ends 
up being used, it will be used really everywhere, and so an ABI breakage 
would be very annoying if it's not kept in a static lib.

Good. I will start moving BError to libnetservices2.a, so that it can
grow more there.

Regards,

N>

Other related posts: