r/cpp • u/TheRavagerSw • Sep 24 '26
Why we should standardise on CPS
To enable any collaboration in the industry, some "social contract" must be signed by all of us.
One of the rules of this contract is binary packaging, to put it simply, if you are a library author you need to either have clean definition on what package you expect to consume or have a "scriptless" implementation like imgui.
If the library exports a pkgconf package, but its dependency exports something else your build will not work. Why should it, what you do makes no sense.
Currently I'm literally forced to package every single dependency I have, which is fine in principle as you want to own your dependencies for security and licensing reasons... But I CAN'T UPSTREAM MY CHANGES which is not fine.
The current situation is a disease, please do remember my talk when you try to build a library like dawn or SDL and it vendors dozens of libraries to create a giant shared library after a long slow build.
View all comments
0
u/ABlockInTheChain Oct 20 '26
CPS might be great someday but it isn't even usable yet.
It sounds ideal as a solution for transitive dependencies. My current clunky-but-working solution is to consolidate all dependencies into a
mylib-find-dependencies.cmake. I run that script to configure mylib but also install it alongside the cmake target files and set up some hackery such thatfind_package(mylib CONFIG)will executemylib-find-dependencies.cmake.Inconvenient to set up initially but reliable and low maintenance afterward.
The first thing that happened when I added
install(PACKAGE_INFO ...to mylib is a string of errors about things I can't fix and shouldn't need to care about:...
That's great. CPS clearly isn't ready to use yet so I guess I'll check back in a year or two.