Bug Tracker Ticket #17256 "Make libshared symbols hidden "

Make libshared symbols hidden Bug Tracker Ticket #17256

This is a blocker not a bug

Explanation about the libshared library by PulkoMandy:

Well the ticket definitely deserves more explanation about the problem and consequences. Maybe it’s clear in your mind, but not everyone may have followed the problems that lead to this.

So, here’s the context for anyone curious about it.

libshared is a library with various experimental features in Haiku. Initially it was meant for internal use only by apps included in Haiku. However, several developers wanted to use these in apps outside Haiku too, so we had to provide some solution for them. The “right” solution would be to finalize these features and make sure the API and ABI is stable for them. But this takes a lot of time and effort, so it never gets done.

Eventually people found their own way, for example by copy-pasting code from libshared into their applications, creating more versions of that code and making everyone work harder. So we made libshared available for 3rd party apps. It is built as a static library, that means each app will have its own copy of the code bundled at compile time, and if the code in Haiku changes, it is not a problem. At least in theory.

But then we started using libshared more and more, and eventually some of Haiku libraries started to use it too, for example libtracker now depends on libshared. This is bad, because now the code that is supposed to be available only in libshared, and bundled into apps, is also available by linking to libtracker, and then it works without needing to bundle it into apps.

So we now have several apps that access this code for example through libtracker. And now when we try to change something in libshared, it breaks these apps and they have to be recompiled. This defeats the purpose of libshared.

The fix for this is making libshared use “hidden symbols”, that means, it can be used for example in libtracker, but then apps using libtracker won’t get access to the libshared code in this way. It restores the safety boundary between the applications and libraries they use.

That’s why we want to do this before R1, and before people start writing too many apps that will break with libshared changes. Can it be moved to a later version? Yes, maybe. But not to R1, that will be too late. If no one has time to handle this in beta4, we will move it to beta5. But that means more apps will hit the problem, and more work to track and rebuild all these apps later. So it’s best to spend a bit on time on it now, and not have all the apsp to fix later.

why did you copy this here?

I think it belongs here.

It is my answer about Waddlesplash’s answer on a question about a bug/blocker from me.

Waddlesplash answered:
Please do not comment on tickets just for the sake of asking how they are going. I am well aware of the beta4 milestone and what needs to be done with it.

I think he is right here. And PulkoMandy posted the answer to my question after that.

I copied it here so people will learn from it and post questions about bugs here and not in the bug tracker. Not everyone is reading the bug tracker.

And because this answer was so nice and complet, I thought it would be nice to share. It is nice for discussion too.

Why not?

you did not put anything up for discussion, you just copied pulkomandys text verbatim. If you have questions about the response then post it on the bugtracker, its perfectly fine to ask for instance what a ticket is about.

It is confusing to have the same discussion happening in multiple places. The information is scattered and people can’t follow what’s happenning. So it’s better to keep the discussion in one place. This is a deep dive into a technical issue and I don’t think there is any use in getting it to the unsuspecting users in the forum :slight_smile:

This was not meant for discussion.

It was meant to inform the user about problems that will occur if they update their nightlies the time Waddlesplash applys the “libshared” patch: #17256 (Make libshared symbols hidden) – Haiku before Beta 4!

EDIT: Resulting in lots of “missing symbol” or “symbol not found” errors.

This is what Pulkomandy said on “Trac”, Haikus-bugtracker, #17256 closed task (fixed)"!