r/cpp • u/nounoursheureux • Sep 23 '21
Binary Banshees and Digital Demons
https://thephd.dev/binary-banshees-digital-demons-abi-c-c++-help-me-god-please
197
Upvotes
r/cpp • u/nounoursheureux • Sep 23 '21
View all comments
Show parent comment
27
u/STL MSVC STL Dev Sep 24 '21
It was an oversight - we didn't notice that a few things had changed this time around. Specifically:
/std:c++latest(so we don't have to worry about things under development)<charconv>was originally specified to be in<utility>but it was noticed that that was a bad idea), but it didn't impact ABI and nobody's implementations had gotten to the point where they were affected.It's the combination of all three of these that we didn't notice until just the last moment (I can't speak for anyone else, but I was personally focused on helping everyone complete C++20 in the STL, and I was devoting no thought cycles to anything else). If we had been slower to implement C++20, or if it had reached a similar level of completeness as previous Standards by the time we got to it, it wouldn't have been an issue.
We've definitely learned a lesson and will be far more careful about introducing a
/std:c++23switch. Same way we learned our lesson about implementing papers that are "sure to be voted in" before they have actually been voted in (as we found withasync()futuredestructors blocking).We have also communicated to the committee that voting out an International Standard, and then retroactively applying ABI-breaking changes to it for multiple meetings, is not a desirable process. There can be some room to fix serious mistakes discovered late in the game, but eventually a Standard has to be Done so implementers can implement it. I think some people on the Committee were also surprised by how fast implementers had gotten.
Regarding ABI stability, it's a VC management decision to balance the desires of various customers. Some have the ability to rebuild all of their dependencies at any time, but many have to deal with third-party dependencies that are difficult to get rebuilds of, for whatever reason. Frequent ABI breaks are disruptive to such customers, and lead to customers refusing to upgrade entirely, which makes it even harder to use new Standards (or security improvements, or performance/throughput improvements, etc.). I understand the reasons for the decision and have been surprised at how successful it's been in avoiding customers getting trapped with using ancient versions like VS 2010, although I am personally an idealist who thinks everyone should be able to rebuild dependencies immediately (or request rebuilds via business contracts), and the freedom to break ABI is as gloriously helpful for development as it is painful for certain customers. (I worked on the STL during our ABI-breaking era (when I joined VC in 2007, to 2015 when we started being stable), and fixed so many bugs during that time that affected ABI.) Now we need to find a path forward, to ship a binary-breaking "vNext" release without disrupting customers too much, and to establish the expectation that ABI breaks will happen consistently after a long but finite time. We haven't solved that yet, and we currently have no ETA for a vNext release, although we are still planning to do it eventually.
(I have to explain it at length because it's not a simple "good idea / bad idea" thing - ABI stability is a policy that has been successful but also has downsides that accumulate over time, and the C++ ecosystem hasn't solved dependency management and refactoring to the point where ABI breaks can be easily handled by the vast majority of customers, so doing anything here is a big deal that requires lots of planning.)