r/cpp • • 3h ago

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?

0 Upvotes

23 comments sorted by

•

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/AKJ7 2h ago

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.

How should it go? The older ones use imperative package declaration, sofar cabinpkg is the only one i found that had a manifest.toml file. It however has its own engine, so now, cmake support is limited. Therefore it needs a public registry that is in alpha state. And it has been 9/10 years since itnwas created.

•

u/AKJ7 2h ago

Also i mentioned that this is the package manager we build for our company made public.

•

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/AKJ7 2h ago

The rust developers could have created PR to the CPP internals, but decided to start from scratch. Sometimes a new beginning is the solution.

How do we deal with fragmentation? All of these other package managers have their philosophy. Conan isn't going to move itself from python to C++. What will happen to these conan.py files? What i propose, is:, we, the community, decide were to go from here. Make a list of features that we want and start working. The standards are too constrained to help us.

•

u/Salty-Paint-9700 1h ago

If there's no standard it's only a matter of time someone won't like the direction and start their own (just like you did!). Creating a viable solution means convincing a lot of people they should drop what they're doing and support your idea. You need toolchains support, at least a couple big player companies to support you, documentation, tutorials, maintenance, active support, thriving community. You need to go to conferences, make presentations, start teaching on socials, get contacts in the industry, talk to and convince people in charge of tools. Gather resources and funding.

You deployed it at your company - great, one down, gazillion to go. Let me run to my tech lead and say there's a guy on reddit that vibecoded a "package manager" that wraps other tools and we should switch to it immediately. He says it's great so it's a sure thing. I have a good feeling about it /s

It takes enormous amount of time, money, patience, active support and skill. Both technical and (even more) non-technical. If you lack any of those, stop. Just stop.

You did not invent anything here. People are trying to do the same thing for decades. Pick an existing solution and contribute to it whatever you can. You have unmeasurably greater chance of succeeding that way.

•

u/AKJ7 1h ago

All that you wrote, is exactly what this post is about in the first place. While programming this project, Claude installed Cargo, installed mdbooks with it, just to build the docs. Why didn't it go for c++?

I just want to hear what this community thinks and see where i can help.

•

u/Salty-Paint-9700 1h ago edited 1h ago

Honestly I couldn't care less about what Claude does or doesn't do. I make my own tech stack choices.

> I just want to hear what this community thinks and see where i can help.

Sure, I'll repeat what I think. The existing fragmentation is the main problem. Don't add to it, reduce it.

You're at step 1 and even that you delegated to AI. Not a great start. There are existing package managers that passed step 53417 and it took them many years and gave them tons of experience in the subject. It's good to believe in yourself but be realistic about it. Pick any of them that meets your need the most. The most. It's not gonna be ideal. It's not gonna do everything you want. Contribute to it so that it does one day.

EDIT: Also, you brought up Rust - that's a 14 year old project that gained momentum in maybe the last one or two, mostly because it's easier for AI. Are you or your company (whichever holds the ownership of that tool) ready to support this project for that long? If I were to switch what assurances can you give me it's not gonna be a dead repo in 6 months?

•

u/steveklabnik1 18m ago

The rust developers could have created PR to the CPP internals, but decided to start from scratch.

There is an important lesson in here: no we (I worked on Rust) couldn't have! Accomplishing Rust's goals required breaking backwards compatibility, which is (reasonably!) not allowed for C++.

If the other package managers are completely unfit for purpose, then yes, you're forced to make a new one. But if they're not, you could also improve existing ones.

•

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/AKJ7 2h ago

I mentioned that this is the package manager we use at our company made public. It is not some random one of software because we tried the other options.

I already took a look a CPS. The reason why cortex depends on cmake and doesn't have its own build engine yet is because CPS is not mature yet to depend on.

•

u/fortsnek274 2h ago

The communities ate me up. Got no single improvement or recommendation.

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/AKJ7 1h ago

But I myself was wondering how it would work with Visual Studio projects.

It generates commands.json files for IDE for now. Visual studio code and Jetbrains extensions are going to get added. For visual studio, it has to load thr generated CMake file, for now.

•

u/fortsnek274 1h ago

Yes, more like a project manager. Standardising packages is one thing, but standardising the entire project? You can't take VS' project system away from me!

•

u/AKJ7 1h ago

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.

Conan is pretty good. It adds python as a dependency and has a steep learning curve.

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.

Cortex does all this. cx upgrade is coming in the next release for depencies upgrade.

So maybe lib authors should just put a conan file in their sources. Maybe that would be a step towards standard packaging.

This could be an option. I am just against writing python code for build systems.

•

u/fortsnek274 1h ago edited 47m ago

I don't like package managers, but I learned the basics pretty quick.

And you can have a text file for simple stuff (*but yes, you will need python if you are a consumable package via conan git requirements).

[requires]
zlib/[*]
nlohmann_json/[*]
#ftxui/[*]
#sfml/[*]
spdlog/[*]

[options]
ftxui/*:shared=True
sfml/*:shared=True
spdlog/*:shared=True

[generators]
MSBuildDeps
#CMakeConfigDeps
CPSDeps

Although, it currently gives me issues. Some packages don't work, and I need to manually do something to get my project to find the DLLs. There's a $(ConanDebugPath) in PATH, but it's empty.

•

u/Salty-Paint-9700 2h ago

> So maybe lib authors should just put a conan file in their sources

Good luck with that. Library maintainers love to put and maintain extra files unrelated to their project in their repos.

•

u/fortsnek274 1h ago

Yes, Reality. Where we all want Standard Packaging, but it just doesn't seem to happen for some reason.

But necessarily, ConanCenter has it's own recipe. So, somebody is already maintaining it.

I am thinking of SFML where building it has become substantially more complicated on Windows since they started to use harfbuzz. If only we had Standard Packaging. Maybe they wouldn't need to maintain this heap of stuff too: https://github.com/SFML/SFML/tree/master/cmake/Modules

•

u/Supadoplex 2h ago edited 2h ago

But for some reason, C++ devs need, for every package we install, to do research

This isn't particular to C++. You always need to do research for every package regardless of language.

Why is this package management issue not yet resolved?

It has been resolved. Many times by multiple people.

none is written in C++

Why would a package manager need to be written in C++?

how do you recommend we tackle the package management problem in this modern age?

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.

  • Do they have the packages that you need?
  • How fast are they updated to latest version?
  • How often do they make mistakes? (most typical mistake is not blocking incompatible dependency versions)

•

u/AKJ7 1h ago

This isn't particular to C++. You always need to do research for every package regardless of language.

When i meant research, i was refering to installation research. What to compile and link to.

It has been resolved. Many times by multiple people.

Which one do you use?

Why would a package manager need to be written in C++?

Why would a plumber call another plumber to fix their drainage problem?

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.

And which one is it?

•

u/Jakabxmarci 2h ago

"It wraps CMake"

oh god

•

u/AKJ7 2h ago

There is no better way, as for now at least.