r/cpp • u/TheRavagerSw • Apr 09 '26
Why committee doesn't decide on a package format?
Why pkgconf or cmake package or CPS isn't officially endorsed by the committee?
Can't cmake or meson guys, who go to meetings and conferences pressure the higher ups to get something accepted?
Multiple build systems are ok, multiple package formats are not. Why no one solves this issue?
16
Upvotes
5
u/parkotron Apr 09 '26
For better or for worse, the C++ standard is high-level and conceptual. It describes the behaviour of one imagined computer building software to run on another imagined computer. It can’t assume the existence of a file system on the machine compiling C++. Heck, it can’t even assume the presence of square brackets.
A package format is a practical concept that needs to deal with the real-world details of real-world compilers, linkers, operating systems, etc. It just way too different from what the standard is to be lumped together with it.
69
u/drodri Apr 09 '26
Not sure why you ask why not one solves this issue. This issue is already being solved. People from Kitware, Bloomberg, Microsoft, Conan, Meson, etc are already working on this, and there are already implementations:
- Latest CMake released support for it: https://www.kitware.com/common-package-specification-is-out-the-gate/
- Conan2 also already supports it: https://www.youtube.com/watch?v=C1OCKEl7x_w (and keeps working on improving support)
The effort is active and people working on it:
- Slack #ecosystem_evolution channel in the CppLang slack
- Montly zoom meetings.
- Mailing list: https://groups.google.com/g/cxx-ecosystem-evolution/about
Why pushing and rushing for standardization of something that we are still gaining implementation experience, and mostly all major players in the area are actively participating in it and implementing it? Having a de-facto standard implemented by relevant tools is the best thing that we can have towards a later standardization (somewhere, not sure where, because in the C++ standard it has no place, and the tooling standard was dropped).
25
u/Minimonium Apr 09 '26
The tooling group is working on an intermediate format.
Forcing existing tools to adopt one single format for everything is not reasonable and doesn't have direction.
Instead, we can agree on an intermediate format for tools to be able to generate and consume where it makes sense. We can even have separate middleware tools to connect different tools this way if the friction for adoption is too much.
3
u/lightmatter501 Apr 09 '26
If there’s an ISO standardized package format, it needs to meet the needs of EVERYONE.
I suggest you read about Bank Python, and then consider why the committee is so adamant that the C++ standard cannot require a filesystem.
So, if you toss out the filesystem, how do you make packages work in a way that isn’t extremely painful for the majority who do have a filesystem?
How do you make sure the package format handles every SBOM-like initiative of the future?
How do you handle people who want to distribute code that only runs inside of secure enclaves?
What about binary-only distribution in general? Especially when combined with optional dependencies that are determined at build time.
Does a binary package need to include every define? Quite possibly, because otherwise you won’t know if a package was built with 32 or 64-bit time.
What about dependencies that can be provided by many different libraries, such as mpi or a blas?
You end up with many nasty problems trying to do this.
3
u/no-sig-available Apr 09 '26
Yes, why don't we propose a new format that solves all the problems?
https://xkcd.com/927/
20
u/JVApen Clever is an insult, not a compliment. - T. Winters Apr 09 '26
According to this keynote of CppCon 2023, it is being cared about.
My understanding is that CPS is actually a step towards standardization of such a format. They are not doing this via ISO as it's just too much overhead if you don't have a working solution. As such, they are first making an implementation and making a specification to prove it can actually work before spending time on papers.
I also like what's presented here. It explains that the concept of CPS already exists for python and how it works.
2
u/MRgabbar Apr 09 '26
cmake is not a package manager
15
u/EmotionalDamague Apr 09 '26
Packaging C/C++ dependencies is painful.
Just look at the knots Linux distro packagers tie themselves into.
2
u/pedersenk Apr 09 '26
Remember that C++ is used in so many places outside of Windows/Linux/macOS.
Neither pkgconf or cmake packaging really work with embedded platforms and toolchains Zephyr, gcc-avr, etc.
Many platforms also need patches for a package to build (i.e SDL2 on FreeBSD). There is no scalable way to include patches for every system possible into a single package.
1
u/James20k P2005R0 Apr 09 '26
I think most of the answers in this thread are missing a lot of the picture here. C++ was actually working towards a lot of broader ecosystem/tooling work, with pretty much unanimous approval from the committee. About a year ago, the attempt to progress this through ISO got scrapped by the authors
You can read about why here:
https://www.reddit.com/r/cpp/comments/1hgpz0y/wg21_aka_c_standard_committee_december_2024/
The tl;dr is committee politics got in the way of making progress and bumped out important time for tooling, in the rush to kill Safe C++. Work is now continuing to progress outside of the committee, but basically wg21 dropped the ball very hard
3
u/AKostur Apr 09 '26
Start writing your proposal. That’s how it gets done (or at least started). But you also have to ask yourself why it doesn’t exist already. Also consider: what if makefiles were standardized for that 30 years ago? We wouldn’t be able to move away from it.
1
u/Farados55 Apr 09 '26
Imagine thinking pressuring the committee will make them do things.
People have been pressuring for decades. It is slow and the committee is an eldritch being.
1
u/Expert-Map-1126 vcpkg maintainer BillyONeal Apr 09 '26
My (and vcpkg)'s position is that everything that speaks CPS already speaks CMake configs, so we are reluctant to try to create/deploy a "situation: There are N+1 competing standards."
People don't like that pkg-config is so limited, but the reality is pkg-config is the lowest common denominator that everything speaks.
-1
u/zerhud Apr 09 '26
0
u/slithering3897 Apr 09 '26
It would be nice, but CPS should be sufficient, as long as it gets adopted. It could be used by cmake, VS, system package managers, lib binary downloads, everything.
-2
u/[deleted] Apr 09 '26
[removed] — view removed comment