Let's talk about package managers
Guys,
It's 2026 and almost 2027. We have AI designing PCBs, doing bank transfers and assisted self-driving cars. But for some reason, C++ devs need, for every package we install, to do research. Why is this package management issue not yet resolved?
Others have tried: VCpkg, conan2, build2, cabinpkg, SCons, CMake's Fetchcontent. All have steep learning curves, none is written in C++ , and feel like compromises. Coming from cargo and uv, i just couldn't believe the CMake boilerplate. `cmake init`? `cmake new`? `cmake add`? Need to do everything by hand. Want an http client? Want a testing library? Want to manage documentation? Figure it out yourself.
We created a package manager for C++ at my company for dependency resolution, as none of the existing package managers were complete. 2 weeks ago, with AI's help i created a public version of it, called cortex (`cx`) and released it on reddit. It uses pubcrub package resolution, mixes `uv` and `Cargo` features for declarative package management in C++, writing in modern C++ 23. It wraps CMake and lets it do most of the work, at least until the build engine is built.
The communities ate me up. Got no single improvement or recommendation.
A question to the community: how do you recommend we tackle the package management problem in this modern age?
•
u/Minimonium 2h ago
First thing you need is to learn what is the biggest challenge for these package managers.
Improving the learning curve is cool, but your approach is deciding that you're smarter than hundreds of other people to try to create your own thing instead of contributing to the existing ones.
If you fail to grasp why does the complexity exist - you'll fail dramatically as you simply do not understand the problem.
•
u/Salty-Paint-9700 2h ago
> how do you recommend we tackle the package management problem in this modern age?
Stop making new package managers. You're making it worse.
The problem is not the package managers themselves. Those can be improved. Any and all of them. Same goes for tooling and integrations. The problem is C++ community has decades of not having a unified way to do this, a handful of common choices now and a metric ton of custom inhouse solutions (like yours here).
Basically incredible fragmentation. You don't deal with fragmentation by fragmenting it more (XKCD standards comic is relevant here). Pick a side (existing one, not new) and pump a boat of money into promotion and adoption by tools.
•
u/azswcowboy 2h ago
> how do you recommend
Use Conan, vc package, or your platform packager. You likely got limited response because the problem is much more difficult than people think and one off attempts go nowhere. If you’re even mildly serious please go look at CPS - common package specification - which is where all of this should go in the future.
•
u/fortsnek274 2h ago
Yes, A. I. wasn't appreciated as far as I remember
But I myself was wondering how it would work with Visual Studio projects.
Conan is almost the ideal package manager. You can get it to output props files, and that's the only thing you need to reference in your VS projects. Or it can output CPS which is what should be universal one day, if VS gains support.
And Conan can fetch sources directly from git, if there is a conan file in it. That lets the lib author manage their own package. So you don't have to wait for package updates. One of my pet peeves with package managers.
Taking a few more steps, in some magical standard packaging world, all conan would then need to do is map package name to URL. Maybe it can use git tags as versions. It would be as minimal as a package manager can get and compatible with any build tool CPS works with. And it would be taking an existing package manager rather than adding a new one.
So maybe lib authors should just put a conan file in their sources. Maybe that would be a step towards standard packaging.
•
u/Supadoplex 2h ago edited 2h ago
This isn't particular to C++. You always need to do research for every package regardless of language.
It has been resolved. Many times by multiple people.
Why would a package manager need to be written in C++?
By far the most effort required in a package manager is with maintaining the packages and their dependencies. I would recommend using whatever option has the best record of maintenance.
•
u/Jakabxmarci 2h ago
"It wraps CMake"
oh god
•
u/steveklabnik1 20m ago
There was a thread on this four days ago: https://www.reddit.com/r/cpp/comments/1yaj399/why_we_shouldnt_want_a_remote_package_registry/