Stabilizing libc++'s ABI v2

Hi,

I'd like to know whether folks currently have breaking changes planned for the version 2 ABI of libc++. Are we aware of improvements that would require breaking the ABI and that we have not implemented yet?

If not, what would be the general feeling about declaring the ABI v2 as stable and starting to iterate on the next ABI as version 3?

Louis

The one I'm aware of is a compressed mangling for versioning namespaces:
  https://github.com/itanium-cxx-abi/cxx-abi/pull/69

Does Apple have a plan to migrate off ABI v1?

/Eric

We don’t talk publicly about any internal plans, but any vendor that supports back-deployment to old OS releases couldn’t migrate off v1 until a very long time after shipping v2.

I have a note to fix XXX::set_value to use call_once when I can break ABI, so I should do that first.

– Marshall

You also mentioned some <regex>-related changes:
https://bugs.llvm.org/show_bug.cgi?id=35967#c2

Right, those two items are exactly the kind of thing I was thinking about. Let’s implement those and put them behind ABI macros just so we don’t forget. When we are ready to stabilize the ABI we won’t miss those changes.

Louis

libc++ should support only three ABI versions at once: deprecated, stable, and unstable.
Making v2 stable means deprecating v1. The time between deprecation and removal
limits how often we can cut a new ABI.

How long should we support the deprecated ABI’s for?

/Eric

libc++ should support only three ABI versions at once: deprecated, stable, and unstable.
Making v2 stable means deprecating v1. The time between deprecation and removal
limits how often we can cut a new ABI.

I’m not sure I agree with this. If the time required for people to move off v1 is too great (and I think it is quite long), I don’t see harm in maintaining multiple stable ABI versions at a given time. Basically, each ABI version just opts-in to some new ABI break. Eventually, if a stable ABI version is not needed anymore, it can be removed.

Otherwise, stabilizing ABI v3 will be blocked on the slowest “customer” moving off ABI v1, but in some cases this may be an unbounded amount of time.

Louis

libc++ should support only three ABI versions at once: deprecated, stable, and unstable.
Making v2 stable means deprecating v1. The time between deprecation and removal
limits how often we can cut a new ABI.

I’m not sure I agree with this. If the time required for people to move off v1 is too great (and I think it is quite long), I don’t see harm in maintaining multiple stable ABI versions at a given time. Basically, each ABI version just opts-in to some new ABI break. Eventually, if a stable ABI version is not needed anymore, it can be removed.

Otherwise, stabilizing ABI v3 will be blocked on the slowest “customer” moving off ABI v1, but in some cases this may be an unbounded amount of time.

I agree with Louis.

Of course ABI versions with no users shouldn’t be supported, and ABI version users should help maintain these versions. We’d be signing up to help maintain v1 since we’ve shipped it and have developers who rely on it.

At the same time, this shouldn’t block new ABI versions. We shouldn’t be creating a new ABI every week, but we should be able to create new ones when it makes sense to do so. We don’t really need a policy on “when do we create new stable ABIs”: a thread like this is good enough given the number of developers in libc++. The point of this thread is to figure out: what’s missing from v2’s stability, and what’s our timeline.

I therefore disagree that libc++ should support only three ABI versions at once.

It may be more palatable to maintain multiple stable APIs if there is a good (automated) test plan that can ensure stability. Does such a test plan exist?

It may be more palatable to maintain multiple stable APIs if there is a good (automated) test plan that can ensure stability. Does such a test plan exist?

We need to keep each ABI stable with respect to itself, which is what we're doing today with ABI v1. It just means that we need to run whatever ABI tests we're running for each ABI version. So, for example, this means making sure that programs built against an old libc++ using ABI v2 still run when linking against a newer version of libc++ on ABI v2. We already have tests to this effect for ABI v1, and I don't see any roadblock to doing that for ABI v2 too.

Note that I'm not "happy" about having to maintain multiple ABI versions. What I'm saying is that if we limit ourselves to 3 concurrent ABI versions, we might just be limiting ourselves to 3 ABI versions forever (since some people might not be able to migrate off v1).

Louis

I landed the regex changes in r357190.
– Marshall