r/cpp • u/TheRavagerSw • Feb 28 '26
Language specific package managers are a horrible idea
Package managers should only deal with package cache and have a scripting interface.
Package managers trying to act smart only makes our jobs harder as evidenced by looking at the issue pages of global package registries.
I recommend everyone here to switch to Conan and not use any abstractions for the build systems, disable remote and use a deployment script or using full deploy as an option. It is not ideal, but it doesn't stand in your way.
0
Upvotes
View all comments
Show parent comment
2
u/not_a_novel_account cmake dev Mar 02 '26 edited Mar 02 '26
PyPI is exactly that, you upload pre-built binary wheels ("wheel" is the the Python package format) of the C/C++/Rust/Fortran code after it has been built. Only when building the wheels does cargo's ecosystem need to be available.
PyPI already costs the equivalent of millions of dollars to host for the Python ecosystem (the services are donated), they cannot also be the Rust ecosystem and the C++ ecosystem and they have little desire to become so. Nobody else in the language space even tries to do this. All the other players distribute only as source code.
Also PyPI only pulled that off with heroic engineering to solve the libc problem and it still doesn't really work. Several big players in C++ are moving away from binary distribution entirely, their position is that all code must be built under the same toolchain with the same flags. That totally precludes binary distribution.
Which is fine, that's the status quo for every other language, the problem is still where does it live and how do you describe the diverse, polyglot ecosystem?
One thing is for sure, it can't live in
git. This has been tried so many times, including with Cargo, Conan, and vcpkg, and we know it doesn't work. Once again, Andew Nesbitt has written about this. No one has gotten much farther than "git won't work" and "maybe something like how Crates.io works".For the remaining questions, we've kicked around several times that the solution looks something like PEP 517/518 from Python land, where the project description is decoupled from the build system and the packaging format. There's broadening consensus that CPS is suitable as a packaging format, or at least it's easy enough to update every time we run into a shortcoming.
Several people have tried to kickstart writing the actual tool to hook up these pieces and nothing has really stuck without broader support for the underlying pieces. You need to define the packaging format (more or less done), define the interface between the frontend and the build backend (not even started), and ensure those two things are implemented everywhere they need to be (CMake CPS is still partially experimental, Meson and pkgconf are still in conceptualization of how it will work for them).