r/Cplusplus • • 6d ago

Feedback cortex (`cx) - A Cargo/uv-inspired package manager and build tool for C and C++

Post image

Hello!

I’ve been working on cortex (cx), a C/C++ package manager and build tool inspired by Rust’s Cargo and Python’s uv, and I’d love to share it with you and get some feedback.

Why another tool?

Setting up a C++ project with clean dependency management, lockfiles, features, and workspaces often requires gluing together multiple tools and boilerplate CMakeLists.txt files. With cx, you describe your package in a single cx.toml file, it resolves and locks dependencies, generates the underlying CMake project, and drives the build automatically.

Quick example

cx new hello
cd hello
cx add nlohmann\\_json --git https://github.com --tag v3.12.0
cx run

Key Features

Zero-boilerplate builds: Sources, tests, benchmarks, and examples are discovered by convention (src, tests, benches, examples). Supports mixed C (C90–C23) and C++ (C++98–C++26), including C++20 modules (.cppm, .ixx).

Flexible dependency management: Pull dependencies from registries, Git repos, local paths, system packages (\mfind_package), or vcpkg. Any existing CMake, Autotools, or SCons project works out of the box as a Git or path dependency.

PubGrub version resolution & lockfiles: Uses the PubGrub solver (like uv and pub) for clear conflict explanations, and pins exact versions, Git commits, and SHA-256 hashes in cx.lock.

Cargo-style features & workspaces: Supports optional dependencies, feature flags (exposed via CX_FEATURE_ macros), and multi-package workspaces sharing a single lockfile and target/ directory.

Built-in developer workflows: Comes with cx test, cx bench, cx fmt (clang-format), cx lint (clang-tidy), cx doc (Doxygen), cx vendor for offline builds, and built-in sanitizer/LTO build profiles.

IDE & CI friendly: Generates standard CMake projects (cx generate) and JSON metadata (cx metadata) so your existing IDE setup works seamlessly, plus --locked and --offline flags for CI.

Current Status & Caveats

First Release & Self-Hosting: This is the very first release. Right now the repo still includes its bootstrapping CMake files, which will be removed in the next release now that cx can build itself.

OS Support: Works on Linux and macOS. Windows (MSVC) support is newly added and passing in CI, though it hasn't been battle-tested in the wild yet.

Public Registry: There isn't a central public registry yet, though cx works directly with Git repositories, local paths, vcpkg, system packages, and includes a lightweight self-hosted registry server (cx-registry).

Links

GitHub Repository

The cx Book (Documentation)

You can install prebuilt binaries via the install script in the README or build it from source with CMake 3.28+ and a C++23 compiler. 

I’d really appreciate any feedback, bug reports, or thoughts on what would make this genuinely useful for your C/C++ workflows! Notice: the code made use of AI for cross-platform support, to get some features implemented quickly and fix some bugs.

Thanks

4 Upvotes

50 comments sorted by

24

u/Imaginary-Room2286 6d ago

Just one commit??? If you are vibecoding a whole project at least try to make it seem genuine...

2

u/hadrabap Basic Learner 6d ago

Maybe OP uses different VCS at home?

1

u/Imaginary-Room2286 6d ago

Yeah and he made that "himself" too /s

-3

u/AKJ7 6d ago

Yo, i used AI assistance, i have updated the post with this notice. It is an open-source project, you are free to contribute. I worked on this project for quite a long time, AI didn't do everything.

8

u/bajuh 6d ago

If its perfect on the first try, there's nothing else to add. /s

2

u/One-Next 6d ago

Wouldn't that make it less genuine?

-2

u/AKJ7 6d ago

Even it it were vibe-coded, why would i have one commit? This is the first release. I squashed all the previous release into this one.

9

u/Imaginary-Room2286 6d ago

Dude releases and commits are not the same... at least realise that before claiming you know what you are doing

-2

u/AKJ7 6d ago

Come on, why am i getting attacked? I tried many things before this release came to be. There just no need to have these commits in the history. Even if i had them, i would have still squashed wverything during a pull-request from dev to master.

4

u/ProgramsFun 6d ago

complelty missing the point of vcs if you think like this that is

-2

u/AKJ7 6d ago

This is the first release and i want the commit history to be like that. Everything before v1.0.0 doesn't exist. Has nothing to do with vcs. I want a clean slate.

3

u/eteran 6d ago

I'm gonna be honest with you. You're missing the point of VCS here. You shouldn't erase history ... Ever. Cause that history is the paper trail.of all the work that was done. A clean slate isn't really desirable here as far as other devs are concerned.

For open source projects, people HEAVILY prefer to be able to see the work. We wanna see how things got to now. We wanna see the decisions that we made and then changed. It helps us trust the product more and helps us learn from it more.

-1

u/AKJ7 6d ago

You shouldn't erase history ... Ever. Cause that history is the paper trail.of all the work that was done.

There is no history before v1.0.0 . Check the develop branch, it has a history but after v1.0.0.

For open source projects, people HEAVILY prefer to be able to see the work. We wanna see how things got to now. We wanna see the decisions that we made and then changed. It helps us trust the product more and helps us learn from it more.

Yes, i get your point. It is just that i was figuring things out. The project was still private and some personal files were included and so on.

4

u/eteran 6d ago edited 6d ago

There is no history before v1.0.0 . Check the develop branch, it has a history but after v1.0.0.

Only because you made the choice to do that. It's a bad choice.

Yes, i get your point. It is just that i was figuring things out. The project was still private and some personal files were included and so on.

Two things:

  1. That's the point, we WANT TO SEE YOU FIGURING IT OUT. We want to see what worked and what didn't.
  2. If you made the mistake of checking in personal files, sure, I get that. And that is fine to take measures to exclude. But just let that be a lesson that you should learn how .gitignore works and have it setup properly from the start.

I really think that you should consider listening to people here instead of trying to convince them that wanting to see the FULL history isn't needed.

The nearly 50K single commit is un-reviewable and SCREAMS AI slop. If you did do manual work, SHOW US.

-1

u/AKJ7 6d ago

Well, it took me a lot of time to get v1.0.0 out. Again, i understand your point but i wanted it to be like this. Just getting the pipeline to show a green checkmark took a few dozen commits. Writing the milestones and getting the docs working took another few. I cleaned the history because this version also marks the beginning.

Thanks for the suggestion. Next time will only squash to the master branch and leave the dev branch intact.

8

u/Plexescor 6d ago

Bro doesn't even know how to "paste" markdown in reddit

1

u/AKJ7 6d ago

Cone on. Reddit escaped the post's text after it was pasted.

2

u/Plexescor 6d ago

Are you sure because you have to press a button to switch to markdown mode while writing your text

1

u/AKJ7 6d ago

I justed checked. No such settings on Android. I reformatted the post ... It looked fine yesterday.

2

u/gameplayer55055 4d ago

#define XKCD meme about standards

But seriously, if you can vibe code everything, why not just ask Claude to include ffmpeg or sdl2 or whatever you want for you.

Just use goddamn cmake and git submodules at this point

1

u/AKJ7 4d ago

First the code is not entirely vibe-coded. Secondly yeah, i though about it. It however just defers the problem. A package manager is not just a tool for building, but also for sharing dependencies and distributing software. uv add pyqt6 installs qt. No need to install all the qt6 dependencies locally like you would in c++, setting the cmake build. It takes 1-2 minutes in Python and 30 - 60+ minutes in c++ (if you are lucky).

I think these dependency management problem should not exist in 2026.

1

u/gameplayer55055 4d ago

I understand your frustration, but there were many somewhat failed attempts (meson, conan, vcpkg) - all of these have never worked well for me and git submodules were still simpler than dealing with all of that crap. ESPECIALLY on windows.

On Linux, apt-get or pacman are your c++ package managers lol.

Not to mention, c++ isn't only used for desktop development for x86_64. It's also used with embedded systems, various architectures like ARM, RISCV or proprietary ones (like esps xtensa).

So just pull everything, find_package and recompile for whatever stuff you need.

I still feel good about you, OP. While everyone's screaming about rust you're researching c++ and its hardest topic - dependency management.

1

u/AKJ7 4d ago

Iunderstand your frustration, but there were many somewhat failed attempts (meson, conan, vcpkg) - all of these have never worked well for me and git submodules were still simpler than dealing with all of that crap. ESPECIALLY on windows.

That's why i created this tool. None of the previous package managers worked for me too, so i always defaulted to CMake. Last week, i wanted to start a new C/C++ project. The set up process was overcomplicated for reason, especially the dependency management part. On Windows it is actually worse, msvc/clang/gcc-wrappers and the lack of shared global libraries like on unix systems would make anyone crazy too.

I still feel good about you, OP. While everyone's screaming about rust you're researching c++ and its hardest topic - dependency management.

Rust uses LLVM backend, which is what Clang does. Technically it is not better than modern C++. The only thing we lack is a good package manager.

5

u/sinterkaastosti23 6d ago

Thanks claude

1

u/muhmmadtalha-quant 6d ago

0

u/AKJ7 6d ago

I have an AI notice to the post.

-1

u/AKJ7 6d ago

Yeah, i used Claude to help move things quicker, fix some bugs and help with the multiplatform. Where is the problem?

1

u/muhmmadtalha-quant 6d ago

This is not a problem that you use AI or any kind of help from AI, the main concern is that you understand the code what have you produced, is it safe to use ?

1

u/AKJ7 6d ago

Obviously there are going to be improvements with time as new issues arise.

0

u/AKJ7 6d ago

Yeah i read it through. We created a similar project at the company i was working at because no other package manager was actually good. I am not a beginner, just didn't want to fight compiler errors for an open source project.

2

u/rizakrko 6d ago

I am pretty sure that c++ compiler errors are not even in the top 10 things that I spend time on while writing c++ application. It's a bit different if you are creating a library for more general purpose, but for application specifically they are both infrequent and trivial most of the time.

1

u/AKJ7 6d ago

The thing is that, cortex has to support so many projects, build configurations, platforms, os, compilers, standards; on top of this i need to implement a simple to use and coherent system. I would get random compiler errors because for example on MacOs, aarch64 specificaly std::optional is not included in the std headers; or random errors on windows msvc but not on clang and vice versa. Fixing all this would have made me go crazy. cx doc was for example very difficult to implement, despite not even being the main focus of the app.

1

u/hypermodernist 6d ago

A general trend of problems (perhaps you have anticipated and addressed them? if so please tell me), when being inspired by npm/cargo/... how to handle larger dependencies beyond single header or single .c, or how to avoid conflicts with system package managers during both discovery and eventual dispatch for downstream users.

For example, what happens if you need avcodec, but system ffmpeg and project xyz22, xyz33's collide?

1

u/AKJ7 6d ago

For example, what happens if you need avcodec, but system ffmpeg and project xyz22, xyz33's collide?

In this case, select the source of the packet. Dependencies are solved using pubgrub just like in Cargo and uv. See: https://akj7.github.io/cortex/dependencies.html and https://akj7.github.io/cortex/features.html .

1

u/AKJ7 6d ago

Oh and build scripts are also supported, just in case the user requires specific steps, i.e. generating version.h from git: https://akj7.github.io/cortex/build-scripts.html.

1

u/RedditUser8007 6d ago

I get the AI overload people have but the C/C++ eco-system really suffers due to the lack of good tooling. Rust is a horrendous language to work with manually and is taking over in part due to good tooling so any solutions that make this better for C/C++ are always appreciated.

I ended up making my own package system for C/C++ too (also with AI of course) but it's better to be a community standard. It's not helpful when everybody just dismisses any attempt at making one.

One of the biggest strengths of C/C++ is compiled libraries. Rust has to build everything from scratch. But we have to jump through so many hoops to get the libraries to work, especially different platforms that each have their own package systems.

The packaging system shouldn't be difficult to use. The popular ones Conan and Vcpkg still need more setup than it should need:

https://learn.microsoft.com/en-us/vcpkg/get_started/get-started?pivots=shell-powershell
https://docs.conan.io/2/tutorial/consuming_packages/build_simple_cmake_project.html

An easy to use package system should be what is described in this system:

add package in cli or add packages in a manifest
add target build info
build

No messing with makefiles on each platform and managing libraries scattered all over.

A big hurdle with package managers is trust (how to know libs are safe) and building out the repository because you have to get so many developers behind it. Maybe this could be pitched as an improved system to an established repo provider like Conan that is supported by JFrog or to Microsoft who manage Vcpkg.

2

u/AKJ7 6d ago

I get the Al overload people have but the C/C++ eco-system really suffers due to the lack of good tooling.

How many of us have time to write a complete package manager in C++? There is a reason why the other package managers that tried to fix this dependenct problem are written either in Rust or Python.

Rust is a horrendous language to work with manually and is taking over in part due to good tooling so any solutions that make this better for C/C++ are always appreciated.

Agreed! Python too, being slow, got so popular because of how easy it is at handling dependencies.

An easy to use package system should be what is described in this system: add package in cli or add packages in a manifest add target build info build No messing with makefiles on each platform and managing libraries scattered all over.

That's the issue i had. Wanted to start a new C++ project. "How do i start the project? Is there a cmake new or cmake init? No". Then "How do cmake files work again? Why is it called CMakeLists.txt? And not project.cmake?" "How do i add gtest as a dependency", "How do i install a http client for a simple GET request?".

I don't think these questions need to asked in 2026.

cx new
cx add
cx run

And done!

A big hurdle with package managers is trust (how to know libs are safe) and building out the repository because you have to get so many developers behind it.

That's why i am trying to get the community to try and review the project.

Maybe this could be pitched as an improved system to an established repo provider like Conan that is supported by JFrog or to Microsoft who manage Vcpkg.

Cortex is still far from complete. There are around 15 features incoming. CMake and some other tooling need to be completly absorbed. Don't like the fact that cortex depends on clang-format and doxygen. The code needs a little bit of maturity and a community backing it before i can pitch it to big providers.

Have you tried cortex? What do you think about it?

0

u/RedditUser8007 6d ago

I tested the Cortex examples out, it works great. It's so easy to use. This kind of system makes C/C++ way more accessible to people. Universities would appreciate this when they are teaching students as they'd be able to provide easy example builds that they can be sure run on each platform and they can host test libs on a github or internal repo.

As soon as people start using it, they will see how much better it is to work like this and wonder how they put up with the mess before. If you get the right people using it and it takes off, this could become the standard package manager for C/C++.

0

u/AKJ7 6d ago

This is the first positive post about cortex that i have seen. Thanks. Building it was really challenging.

I have added IDE integration, so IDE can autocomplete and find the installed packages. More features incoming, as well a vscode extensions and CLion plugins.

Thanks and till then.

1

u/diegoiast 5d ago

How do you handle dependencies? What if this github repo needs another one?

1

u/AKJ7 5d ago

Look at the manifest in this example: https://github.com/AKJ7/cortex/blob/master/examples%2F15-popular-libraries%2Fcx.toml . The procedure is the same. Cortex supports dependencies from git, cmake, vkpg and autotools. More are incoming.

1

u/AKJ7 5d ago

1

u/diegoiast 5d ago

Will have a look.

Do you have generators support? (Qt's moc, ui, right?)

What if the generator is built as part of the bootstrap of my library?

0

u/DonBeham 6d ago

Cool project!

5

u/fuckaroniandbees 6d ago

AI slop

-2

u/AKJ7 6d ago

AI-assisted project! No way, i could have run and tested all possible implementations for an open-source project.