Page MenuHomeFreeBSD

Update shared library advice now that a.out no longer is a consideration
ClosedPublic

Authored by imp on Feb 4 2021, 9:11 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Dec 10, 3:16 PM
Unknown Object (File)
Oct 2 2024, 9:25 AM
Unknown Object (File)
Oct 2 2024, 8:15 AM
Unknown Object (File)
Oct 2 2024, 7:57 AM
Unknown Object (File)
Oct 2 2024, 6:58 AM
Unknown Object (File)
Oct 2 2024, 6:23 AM
Unknown Object (File)
Oct 1 2024, 10:05 PM
Unknown Object (File)
Oct 1 2024, 9:36 PM
Subscribers

Diff Detail

Repository
R9 FreeBSD doc repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

imp requested review of this revision.Feb 4 2021, 9:11 PM
imp created this revision.
imp added a reviewer: kib.
emaste added inline comments.
documentation/content/en/books/developers-handbook/policies/chapter.adoc
326–327

other bullets do not have trailing .

debdrup added a subscriber: debdrup.

Looks good to me too, let's get this in.

This revision is now accepted and ready to land.Feb 4 2021, 9:23 PM
jhb added inline comments.
documentation/content/en/books/developers-handbook/policies/chapter.adoc
325–326

I would be tempted to expand this a bit further and subsume your new point above, maybe something like:

* If there is an incompatible change, there are a few options:

   * If the library uses versioned symbols, bump the version of affected symbols and provide compatibility versions of affected symbols under the old version.

   * If the library uses versioned symbols, but the compatibility cannot be preserved with compatibility symbols (e.g. the layout of an exported global variable changed), bump the major number.  Along with bumping the major number, old compatibility symbols should be removed.

    * If the library does not use versioned symbols, bump major number.  Consider adding a version map to begin versioning symbols when bumping the major.
325–326

Updates from jhb and emaste

This revision now requires review to proceed.Feb 4 2021, 10:30 PM
documentation/content/en/books/developers-handbook/policies/chapter.adoc
326–327

pulled in jhb's and emaste's suggestions.

documentation/content/en/books/developers-handbook/policies/chapter.adoc
325–326

IMO it does not provide the right attitude.

First it should emphasize that ABI should not be broken. If this is absolutely impossible, then the breakage should be done in backward-compatible manner.

For symver-ed libraries, attitude should be that we do not do changes that would require bumping the library version. If the change of the nature that makes it impossible to handle most of the cases with the application of symver, it should be heavily considered if this change worth it at all.

That said, it is not true that gobal symbols cannot be versioned, or that layout changes for them are blockers. For instance, we sometimes grow sys_errlist[] when adding new errno values.

Strengthen the "don't bump major versions" per kib@

documentation/content/en/books/developers-handbook/policies/chapter.adoc
325–326

Updated to reflect kib pointing out the practice is to not bump major versions where possible.

documentation/content/en/books/developers-handbook/policies/chapter.adoc
326–356

We do allow changing the libraries ABI, otherwise FreeBSD cannot evolve. But we make concerned efforts and pay large tax to make ABI changes backward-compatible.

327

This is not what I wrote or asked for. For non-symvered libs, we have no other way than bump library version.

But for symvered, the change that requires library version bump probably should be not done (but other strong reasons must exist to even make this argument for bumping).

330

I think 'top' there is 'to'.

And the wording is strange. I suspect you mean that the version bump should be last, since from now on we would have symver?

331

Also it probably should be noted, that for third-party libraries that do not provide stable ABI or which ABI compat policies are not compatible with FreeBSD policy, we do something special. Either make them private (sqlite?) or just follow upstream (openssl?).

For third-party libs which do provide comparable ABI statibility guarantess, we use upstream tooling (e.g. symver for libstdc++ or libcxx).

documentation/content/en/books/developers-handbook/policies/chapter.adoc
325–326

I agree we don't want breakage. I was perhaps trying to say that there might some extreme cases where symvers alone doesn't save you. Growing sys_errlist isn't one of those, but if we had a public structure and wanted to remove fields from it, that would be painful. OTOH, in my (still WIP) patches to bump fileno in FILE to int I have gone to great lengths to preserve the ABI for fields currently abused by existing software by leaving their ABI intact even when they are hidden in the future.

326

I don't know that we always want a version map. Off the top of my head I would guess that a minority of the libraries in /lib and /usr/lib are versioned. Partly because adding versions itself is a major change requiring a bump, so instead, we should probably defer adding versions until there's another reason to bump and then at that time evaluate if for the given library, adding versions would be a good idea.

try again to see if these changes address kib's concerns

documentation/content/en/books/developers-handbook/policies/chapter.adoc
326

When creating new libraries, we should always do version mapped or the library must be private. for existing libraries, you may be right...

documentation/content/en/books/developers-handbook/policies/chapter.adoc
326

That is to say, the cost of a version map for existing libraries is high. The cost for new ones that want to do ABI stability is low if done from the start. So we should encourage them strongly for FreeBSD-created libraries at least.

documentation/content/en/books/developers-handbook/policies/chapter.adoc
325–326

This probably should say 'for project-maintained shared libraries', since we cannot guarantee ABI stability for third-party. Look at the ncurses saga.

326

This makes the library symver-ed.

326–356

I am not sure where this 'only one increment between major releases' comes from. It would makes HEAD users' live miserable in some situations.

I believe we should not punish them, who provide such valuable and otherwise limited testing of the HEAD.

documentation/content/en/books/developers-handbook/policies/chapter.adoc
325–326

Good point of clarification.

326

Yes. I'm saying that all new libraries should be either symver'd or private unless there's a good reason not to do so.

326–356

It's the current policy that we've done since day one in the project.

Having said that, we can certainly change it since, honestly, it was tied in many ways to the OS == library version notion people had in their heads. And to avoid undue churn, especially in the era when changes were dumped incrementally. And we already bump many times for ports.

So, I agree with you it's a bad policy that we should revisit.

How about: When changing a library in a way that requires a major version bump, please be mindful of the affect this has on users upgrading and try to batch changes where possible to reduce churn.

documentation/content/en/books/developers-handbook/policies/chapter.adoc
326–356

Fine with me.

documentation/content/en/books/developers-handbook/policies/chapter.adoc
326–356

OK. Done, and made it a bullet list, which is easier to read, imho

update with latest feedback... move to bullet points

imp marked 14 inline comments as done.Feb 5 2021, 7:07 PM

btw, I'm starting to think a new review would be good given that all the content has migrated away from the comments...

I spotted a few minor nits.

Also, please take care to either consistently terminate list items with or without a period.
Right now, some list items have it and others don't.

It's outside the scope of this review, but I feel like there should be a style guide for this.

documentation/content/en/books/developers-handbook/policies/chapter.adoc
333

Did you miss a word here?

338

I don't believe listed items should start with 'However' as the indentation already indicates that it's a sub-clause of the above item.

341

A tiny bit of wordsmithing is required here.

344

Tiny typo here.

348

Using our here seems to imply that it's written from a different perspective than the rest of the article.

350

Same as above.

355

Make it clear that exp-runs should be run to catch the full impact.

This revision is now accepted and ready to land.Feb 7 2021, 12:38 AM
This revision now requires review to proceed.Feb 7 2021, 12:39 AM

Looks good to me, let's land this. :)

This revision is now accepted and ready to land.Feb 7 2021, 1:07 AM