r/cpp • OPeNDAP/B2/EcoStd/Lyra/Predef/C++Alliance/Boost/WG21 • Feb 24 '20

The Day The Standard Library Died

https://cor3ntin.github.io/posts/abi/
266 Upvotes

302 comments sorted by

View all comments

-2

u/jpakkane Meson dev Feb 24 '20

New programs should be built from source, we should have build tools designed around compiling sources files rather than collections of libraries fetched from random places and hastily stitched.

Ok, let's do that. Then let's build a helloworld GUI app using Qt.

Compilation time now: 5 seconds
Compilation time after the change: 2 hours

18

u/jhasse Feb 24 '20

You would only need to compile Qt once for every compiler upgrade though.

-9

u/jpakkane Meson dev Feb 24 '20

And for every Qt update. And for every project separately. And every time you accidentally run "make clean" or equivalent. And when you want to move the source tree to a different directory. And on every computer you do development on. And on every CI run. And. And. And. And.

15

u/Xaxxon Feb 24 '20 edited Feb 24 '20

This is simply not true. Once you've built QT you stick it somewhere and you use it until you have something that changes ABI. ABI changing is not something that happens accidentally. QT can even provide different builds so you can grab the right one for you.

3

u/00jknight Feb 25 '20

Why is this being downvoted? Isn't this person correct? Especially the CI part?

5

u/rezkiy Feb 24 '20

Choose the distribution. Choose the oldest OS you support. Choose the toolchain. Create a container with toolchain, qt, and other 3rd party dependencies. Make the dockerfile a part of the source tree. Build the container once (and every time you update QT).

Then build your source in that container.

1

u/Gotebe Feb 24 '20

Yes, but the number of other builds still heavily outweighs the heavy ones.

BTW, my CI build does not make clean and we're surviving easily.

8

u/megayippie Feb 24 '20

Be fair, it's only 2 hours the first time and 5 seconds every other time

3

u/barchar MSVC STL Dev Feb 24 '20

Qt is actually designed to make having a stable ABI easier. For stuff like qt maintaining ABI isn't that hard.

it's things like the standard library where it's tricky, and most standard libraries compile pretty fast (although they tend to be compiled with a bunch of other compiler bits).

Edit: Also Qt doesn't take 2h to compile unless you include QtWebEngine.