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
1
u/not_a_novel_account cmake dev Mar 02 '26 edited Mar 02 '26
If you have several million dollars in hosting services available, feel free to let people know. Otherwise it's more than is spent on any individual project in the C++ tooling ecosystem in a year. Ecosystem infrastructure is a relatively small spend today, tiny teams. The solution will likely be iterative, like Rubygems/Bundler and Cargo were, but we don't know what that roadplan looks like and no one is volunteering to take the wheel. Conan-as-hosting-strategy might end up being the de-facto solution by way of already existing and being generally flexible, but see above about problems with scaling a git-based package db.
C/C++ is not the language with the most developers, but it underlies many other ecosystems. Any solution in this space needs to be able to scale to meet the needs of everyone who uses those ecosystems as well.
So two points:
Minor point: You won't beat Ninja. Ninja is great. Build system people love Ninja. I personally have zero desire (or ability) to ever implement a better rules engine than Ninja. If you want to implement a build system without Ninja you're free to, but that gets rarer every year.1
Major point: There's no reason for there to be a single build backend, and in fact this is unfeasible. You will never get everyone to agree on what the build backend should be. Some people like Meson, some people like CMake, some people like Premake, others XMake, hell the Scons developer released a new build backend like yesterday. You will never get everyone to agree, so give up now.
What you need is a project description format and packaging format that allows everyone to use the build system they want for their project, but keep it isolated to only their project. Their chosen build system builds their code, it produces a universal packaging format which can be consumed by any other build system.
This is how the Python ecosystem works. They have literally dozens of build systems, even more than C++, they do not agree with one another on anything. The ecosystem works because everyone gets to use the build system they personally think is best for their project. The project frontend grabs their chosen build system to build their code, and the rest of the dependency tree consumes the result via the packaging format.
This is exactly why. Many developers don't want their build system to be scriptable at all, they want it to be declarative, or inferred entirely from the directory structure. Or they want it to be scriptable, but they want to write their build scripts in C++, or Python. You have one idea about how this should look, it might be a good idea, it will not reach consensus. Consensus on this problem is entirely impossible. We have tried for over 50 years, since Fortran.
Anything that can compete with the configuration-build model ends up resembling using Ninja as a rule engine, at which point just use Ninja.