[haiku-bugs] Re: [Haiku] #17256: Make libshared symbols hidden

  • From: "Haiku" <trac@xxxxxxxxxxxx>
  • To: undisclosed-recipients: ;
  • Date: Sat, 08 Oct 2022 08:08:17 -0000

#17256: Make libshared symbols hidden
---------------------------+--------------------------
  Reporter:  waddlesplash  |      Owner:  waddlesplash
      Type:  task          |     Status:  assigned
  Priority:  blocker       |  Milestone:  R1/beta4
 Component:  Build System  |    Version:  R1/beta3
Resolution:                |   Keywords:
Blocked By:                |   Blocking:
  Platform:  All           |
---------------------------+--------------------------
Comment (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.
-- 
Ticket URL: <https://dev.haiku-os.org/ticket/17256#comment:5>
Haiku <https://dev.haiku-os.org>
The Haiku operating system.

Other related posts: