r/cpp • • 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

38 comments sorted by

View all comments

Show parent comment

1

u/TheRavagerSw Mar 02 '26

I dont think such a project format is necessary, you can just invoke the other build system while building the package rather than the other. For what you say to be true, package manager needs a config file that gets converted to other build system toolchain files. This mean language specific stuff but alas, ** if you want a global package repository your solution is the only one** . I don’t know how the other languages would fit to this package manager, does zig etc get their own abstractions etc?

For the build system, caring about all users is a waste of time. Just focusing on linux, clang and ninja is enough to build for all possible platforms + gpu's. Yes it is possible to have multiple backends but from the example of cmake and meson it is hard to maintain and doesn't give that much benefit. Build system should be scriptable what people do with their scripting is their problem.

Even with a linux host only cross compiler system, cps could be boon, pkgconfig isn't good as there is a need to write wrapper scripts to use pkgconfig sysroot for example.

2

u/not_a_novel_account cmake dev Mar 02 '26 edited Mar 02 '26

you can just invoke the other build system while building the package rather than the other

How do you know what build system is to be used if you don't have a metadata file to describe it? This is exactly what Python's PEP 517/518 provides. It says "to build this project, download <cmake, meson, uv-build, flit, hatch, distutils, etc>, and run it". That's all the project description format provides, along with some bare minimums like version numbering and project name.

This mean language specific stuff but alas, if you want a global package repository your solution is the only one

No language-specific minutia leaks into the project description format. PyPI has projects written in Fortran, Rust, C++, Zig, and more languages besides. The project description captures none of that. The language specifics go into the individual build backends.

For the build system, caring about all users is a waste of time

I mean, that's fine. You can totally hold this position. I don't want to argue against it. What I would try to tell you is no one in the ecosystem community will be interested in what you have to say if you hold to it. "It won't work for X" is instant consensus against for all of the people actually writing code in this space, and they will not dedicate time or resources to any solution which limits or excludes developer choice so broadly.

Basically, at ecosystems meetings for C++ (and Python PEPs, and I assume Rust RFCs), if someone says "My company does Foo and we need to support that" the answer is never "Your use-case is invalid and we're not going to consider your input". We would all kill each other if we talked like that.

1

u/TheRavagerSw Mar 02 '26

I see, I will look into to the stuff you described. Thanks a lot for the very well written replies.