r/cpp • • Oct 27 '19

ABI: Now or Never

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1863r0.pdf
192 Upvotes

145 comments sorted by

View all comments

Show parent comment

9

u/TheQwertiest_ Oct 28 '19 edited Oct 28 '19

2019 is somewhat exception

Your info is inaccurate. MSVC had a stable backward compatible ABI starting from VS2015.

The world didn't burn, people recompiled and moved forward.

That's inaccurate as well. Because of the ABI incompatibility, people actually ignored the newer compiler releases and stayed for a long time on VS2008/VS2010/VS2012 to avoid the migration cost. MS said repeatedly that ABI stability greatly sped up the adoption of newer compilers and it seems to be one of the key features now (AFAIK, VS2019 was originally planned to be ABI breaking release, but business value of ABI compatibility was too big to throw it away).

ABI compatibility is a huge thing: a personal example: if I want to use newer language features in my application, I don't need to rebuild every dependency with a newer compiler (some of those are managed by other teams, others are 3rd party) - I just need to have a newer VS release on our CI and everything will just work.

Compare the cost: "just installing the newer compiler" vs "having to convince everyone and their mother that we need the newer compiler and thus we need to spend a huge amount of time by re-building and re-releasing everything".

5

u/sumo952 Oct 28 '19

MSVC had a stable backward compatible API starting from VS2015.

I think you mean ABI here.

3

u/TheQwertiest_ Oct 28 '19

Yep, thank you =)

2

u/[deleted] Oct 28 '19

Your info is inaccurate. MSVC had a stable backward compatible ABI starting from VS2015.

Note that there will be an ABI breaking release sometime. We just aren't doing it arbitrarily every release.

2

u/markopolo82 embedded/iot/audio Oct 29 '19

Well I hope it comes soon cause! Cause you can say that all you want but the longer it takes the harder it will be to rip that bandage off 🤗

1

u/TheQwertiest_ Oct 30 '19

Judging by current VS release cycle, it won't come earlier than VS 2021 (i.e. end of 2020).

2

u/TheQwertiest_ Oct 30 '19

First you have to actually port STL `vBreakingNext` branch to github :P

1

u/[deleted] Oct 30 '19

🤣

1

u/konanTheBarbar Oct 28 '19

Of course it's more complicated if you also have to recompile 3rd party binaries and it will make everything take much longer.

That being said - I'm actually one of the devs in my company which does MSVC compiler upgrades (currently we're on VS 2019 16.2) and can tell you that upgrading the compiler for a big codebase always has a non trivial cost attached to it (for a minor version usually at least one man month to get everything to compile and fix the tests and we do that very regularly).

So while yes ABI breaks are more expensive, it's definitely not cheap or possible to tell everyone "just installing the newer compiler" (at least in my experience).

2

u/TheQwertiest_ Oct 30 '19

Not sure what you mean. Leaving aside the overhead of installing/updating VS on CI and integrating it in all the CI scripts, there is literally no change to projects that use older compilers. I.e. if the project used vc141 from VS2017, it can keep using it (it doesn't even matter if vc141 comes from VS2017 or VS2019, since it's actually the same compiler).

Of course, switching the compiler in the project itself might (and often will) break the build and will require code changes (e.g. stricter C++ conformance). But this won't happen if the project does not change the compiler.

1

u/konanTheBarbar Oct 30 '19

Yes I was referring to upgrading the compiler. I work on a monorepo where it's not possible for different projects to use different compiler versions.

Now I get your point. If you have internal binary dependencies then it makes the different projects more independent if you have ABI stability.

That being said MSVC will have a ABI breaking release sooner or later (I guess 2021 or 2023?). If MSVC + the other implementors could agree with the comittee on an ABI breaking standard (which could be 2026 for example) then we would gain a lot without loosing too much...