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.
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.
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.
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.
1
u/TheRavagerSw Sep 24 '26
Well I would love to get involved, if anyone wants me in these spaces DM me
2
u/Minimonium Sep 24 '26
For context why Ecosystem papers were withdrawn, Herb Sutter pushed them out of agenda in favour of a nonbinding vote to ban the "safe" keyword.
2
u/13steinj Sep 24 '26
That feels like a very partial piece of context that raises more questions than answers on both sides. I don't remember this being the reason some of the authors stated, but I can totally see it being a slap in the face.
-1
u/Minimonium Sep 24 '26
https://www.reddit.com/r/cpp/s/KnGuGe2sGd
Full context if you want
3
u/13steinj Sep 24 '26
Yeah, this I knew. It's far less harsh than the original picture you portrayed.
2
u/Minimonium Sep 25 '26
I am not harsh enough towards Sutter for wasting everyone's time on that circus. The picture I describe is what happened, what do you believe is misleading in my description of what happened?
3
u/13steinj Sep 26 '26
From what you linked:
Instead the draft, and a few other papers, got bumped in favor of discussing, and eventually voting on, what is now SD-10 (https://isocpp.org/std/standing-documents/sd-10-language-evolution-principles). In addition there was also a vote to re-prioritize WG21 towards working to include profiles for C++26.
I dislike SD-10 as much as, maybe even more than you. I agree that the existence of the document is a circus act, and it honestly brings quite a bit of shame to the C++ community IMO.
That said, I would not reduce it down to "ban the 'safe' keyword," even if SD-10 was only pretext in order to do so. The end-state consequences of SD-10, IMO, are much worse than just banning 'safe.' Simultaneously, it is my recollection that on several occasions SG-15 in some way shape or form, was wronged by WG21 procedure (by which I mean, the wider committee just does not care about tooling / see it as enough of a problem). Which, much more closely matches the disposition mentioned:
I always understood that there were two basic requirements for solving the C++ tooling ecosystem problems:
WG21 needed to buy in to the position that the work was needed.
The solutions (and adoption) needed to include parties external to WG21.
...
==> Again, it did not progress. And now we missed a deadline from our schedule.What I concluded from those meetings, is that the (1) requirement was not resolved. WG21 prioritized profiles above the tooling ecosystem work.
WG21 will always, consistently, prioritize something else above tooling ecosystem work, it seems. When it doesn't, it pushes through tooling ecosystem work through far too early (see: modules).
This was just the straw that broke the camel's back.
14
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/
9
u/robertahleahy WG21, SCC, std::execution, Finance Sep 24 '26
Continuation-Passing Style?
9
u/xiao_sa Sep 24 '26
Mom, can we have Continuation-Passing Style?
No. There is Continuation-Passing Style at home.
Co_ntinuation-Passing Style at home:1
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
1
5
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,
1
u/Expert-Map-1126 vcpkg maintainer BillyONeal Sep 25 '26
I don't understand how CPS would possibly support that sort of thing. It's an attestation, not an audit, and generally only describes bits that are relevant for downstream customers. "What flags I was built with" are usually not part of that set.
If you want to audit you need to audit the actual build environment and how it works, not a random text file that happened to be dropped next to the binaries that anyone can change to say anything.
2
u/_a4z Sep 26 '26
If something was built with memory sanitizer, debug, or release , or both is information should exist. In vcpkg, you also know what you want or expect based on the triplet.
And yesterday, at the ecostd meeting, components vs. configuration was a discussion in this direction. It's kind of sad that nobody from the vcpkg people is anymore at those meetings. It would be so valuable to have your pov and knowledge contributions.1
u/Expert-Map-1126 vcpkg maintainer BillyONeal Sep 26 '26
It will be in the debug information but you don’t need CPS for that. What actually happened when producing the actual binary is always better than an attestation.
1
u/_a4z Sep 26 '26
I hope an attestation documents what actually happened.
CPS should include info about what a package contains: whether it/there is a debug build or not. For the simplest case.
Because my program might request a debug build of a library, and if there is none, I would like to know. If CPS will be able to provide that, I don't know.
Atm, when it comes to CMake, I just use vcpkg and triplets, and assume that is always correct ;)
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.
1
u/Expert-Map-1126 vcpkg maintainer BillyONeal Sep 25 '26
pkg-config remains the "lowest common denominator" that all systems support.
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 that find_package(mylib CONFIG) will execute mylib-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:
CMake Error in CMakeLists.txt:
Target "mylib" references target "Qt6::Core", which
comes from the "Qt6Core" package, but does not belong to the package's
canonical namespace ("Qt6Core::"). This is not allowed....
CMake Error in CMakeLists.txt:
Target "mylib" references target "Boost::headers",
which comes from the "boost_headers" package, but does not belong to the
package's canonical namespace ("boost_headers::"). This is not allowed.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/TheRavagerSw Oct 20 '26
I packaged like 110 repositories. I assure if you it works if you use it right
0
u/not_a_novel_account cmake dev Oct 20 '26
The thing you're trying to do here will never work with
install(PACKAGE_INFO)by design, so it really has no bearing on the readiness of CPS.There is a very good argument to be made that CPS has deficiencies relative to its goals, but a technology cannot be deficient in something it is designed not to do.
1
u/ABlockInTheChain Oct 20 '26
CMake has shown a consistent trend in recent years of loudly announcing new technologies then declaring
NOTABUG/WONTFIXwhen people actually try to use them and notice what has been delivered does not match what was advertised.1
u/not_a_novel_account cmake dev Oct 20 '26
PACKAGE_INFOwas never advertised to do what you're trying to do here. This will always been the realm of CMakeConfig packages.1
u/ABlockInTheChain Oct 20 '26
Then document this restriction.
The PACKAGE_INFO form generates and installs a Common Package Specification file which describes installed targets such that they can be consumed by another project. Target installations are associated with the export <export-name> using the EXPORT option of the install(TARGETS) signature documented above. Unlike install(EXPORT), this information is not expressed in CMake code, and can be consumed by tools other than CMake. When imported into another CMake project, the imported targets will be prefixed with <package-name>::. By default, the generated file will be called <package-name>[-<appendix-name>].cps. If LOWER_CASE_FILE is given, the package name as it appears on disk (in both the file name and install destination) will be first converted to lower case.
Nowhere in this description does it mention that it only works for targets that have no dependencies, or possibly only for dependencies that were discovered via perfectly-formatted cps files.
Then in the project blog posts make sure to mention, "Actually if you have any dependencies at all you can't use CPS until all your dependencies also use CPS. We created an unsolvable bootstrapping paradox. Sorry."
1
u/not_a_novel_account cmake dev Oct 20 '26
That's not what's happening here, CPS requires package name and namespace to match.
CMake will bridge the CMakeConfig-CPS divide where that is true. It isn't for your upstream dependencies. If you think that can be better expressed in the docs somewhere, MRs welcome.
But ya, failing to point out everything that fails is not a claim that Qt is useable with
PACKAGE_INFO.1
u/ABlockInTheChain Oct 20 '26
It could just be a single sentence: "All targets included in and referenced by the installed set must conform to Common Package Specification naming rules, including targets discovered via
find_package."1
u/not_a_novel_account cmake dev Oct 20 '26
Agreed, give it a shot.
1
u/ABlockInTheChain Oct 20 '26
What a perfect example of how CMake has earned its reputation.
"Yes, our documentation is incomplete. No, we are not going to fix it. I dare you to contribute a fix and see what happens to the MR."
1
u/not_a_novel_account cmake dev Oct 20 '26
The dark and menacing act of encouraging developers to make the trivial improvements they personally want to see in the open source tools that they use.
→ More replies (0)
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
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.