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.
4
u/fortsnek274 Sep 24 '26
Yeah, I'm also a CPS fan. It could separate package management and dependency management. That OO principle of separation of concerns, reduce coupling.
It would be great if you could have your package manager in one window, and all your IDE cares about is the CPS files it dumps somewhere. Thereby untangling your project from what package manager is used.
But package names would need to be the same. And what if you have two package managers that provide the same lib.
3
u/13steinj Sep 24 '26
The committee had the opportunity to get an Ecosystem IS off the ground, and while it is unclear if the tooling group got fed up or if the rest of the committee made it clear that it won't happen, at the end of the day in somewhat dramatic fashion one day all the papers were withdrawn.
I will admit, I felt that the original goals of the Ecosystem IS were shortsighted and contradictory, I left a comment here about that at the time.
There is slow movement in some Discords and GitHub organizations and Slack spaces that I don't have the links to. At one point one of the people here told me to get involved last year to which my response was along the lines of "yeah... maybe..." but reality is I don't have the energy to expend on something moving this slowly (if at all).
All that said and done CPS is a package manager spec, not a build system spec: you'll still have difficulty upstreaming your changes because many problems exist at the build system level.
14
u/crowbarous Sep 24 '26
This poster is becoming tiring.
16
u/no-sig-available Sep 24 '26 edited Sep 24 '26
CPS?
Clicks Per Second
Collaborative & Proactive Solutions
Cyber-Physical Systems
Cost Profit System
Child Protective Services
Clean Pipe System? https://www.cps.se/
1
u/pdp10gumby Sep 26 '26
only clocked on the post (I read Reddit via RSS) because that’s what I immediately thought was meant by CPS.
1
u/equeim Oct 02 '26
Does it support modules yet?
5
u/epasveer Sep 24 '26
I ain't signing shit.
2
u/_a4z Sep 25 '26
Last time I looked, CPS missed a section to tie requirements to build flavors.
E.g., tell it to check that the package has the expected sanitizer (or, in the future, contract) flags.
To my knowledge, this is only possible in the 'open for adoptions' section.
Sadly, even though some people discussed this at the very first ecosystem evolution meeting.
WG21 is unlikely to look at the topic; they only involve SG15 when they want to confirm something is possible.
Then one of is the expert who says, sure, it works, and then people write that their experts in tooling confirm ... see contracts, for example. But in reality, everything in this direction is implementation-defined and 'vendors will figure it out'.
Also, the most active people from SG15 have not been active there for years, for various reasons.
So while I agree that infrastructure is important to target in a standard way, and doesn't have to be an ISO standard, seeing something actually happen that isn't driven by a customer-vendor relationship doesn't seem to be on the horizon anywhere. And customer-vendor relationships give you what one customer, the one who pays, needs. Not necessarily what makes sense for a larger part of the industry,
2
u/Flimsy_Complaint490 Sep 24 '26
idk i just point CPM to a github repo and it kinda just works. Conan is nice too.
pkgconf is the problematic space but i've used like 2 libraries that are pkgconf only in the past 3 years.
either way, nobody is adopting shit, this is cpp, the home of NiH syndrome.
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.
0
u/Suitable_Plate4943 Sep 24 '26
atp i just rewrite all vendored cmake otherwise they all spend half a minute looking for pthreads and int size each time i add a source file and need to reconfigure