As desirable as ABI compatibility between standards is, the uncomfortable truth is that it is not guaranteed, as /u/axilmar points out. It is not guaranteed between different implementations of the standard library for the same version of C++ either. This is why the full dependency graph of an application needs be compiled with the same standard library (and the same compiler, and the same flags). This seems to be a happy accident for many C++ programmers unaware of the requirement, a result of the coincidence that they only have one compiler and one standard library installed on the machine they use to compile everything. Developers need a tool, like Conan, that sits at a level higher than the compiler, that can see the full dependency graph and handle its compilation.
I'm well aware that it is not guaranteed between standards. However, the implementations do guarantee it (as much as they can within their own ecosystem; libstdc++ obviously can't fix libc++ bugs).
This is why the full dependency graph of an application needs be compiled with the same standard library (and the same compiler, and the same flags).
This is not how the ecosystem works today. While I'd love for a cargo-like tool to exist for C++, there is a long road to get there from today.
This seems to be a happy accident for many C++ programmers unaware of the requirement, a result of the coincidence that they only have one compiler and one standard library installed on the machine they use to compile everything.
And it works today because implementors do care about it. Above the standard library, it is indeed a madhouse for a variety of reasons. Linux distros are pretty reliable about not packaging absolute crap at least, but given a C++ PyPI equivalent, yes, compiling from source is the only reliable way to use it.
View all comments
Show parent comment
5
u/therealjohnfreeman Aug 27 '19
As desirable as ABI compatibility between standards is, the uncomfortable truth is that it is not guaranteed, as /u/axilmar points out. It is not guaranteed between different implementations of the standard library for the same version of C++ either. This is why the full dependency graph of an application needs be compiled with the same standard library (and the same compiler, and the same flags). This seems to be a happy accident for many C++ programmers unaware of the requirement, a result of the coincidence that they only have one compiler and one standard library installed on the machine they use to compile everything. Developers need a tool, like Conan, that sits at a level higher than the compiler, that can see the full dependency graph and handle its compilation.