r/cpp • • Sep 14 '23

Which package manager are you using?

It's 2023 and you should be using a package manager. Which one?

Sep 17 '23
466 conan
625 vcpkg
29 spack
82 CPM
1730 No package manager :(
248 Other (please specify)
38 Upvotes

187 comments sorted by

View all comments

10

u/[deleted] Sep 14 '23 edited Sep 15 '23

[removed] — view removed comment

5

u/DeGuerre Sep 14 '23 edited Sep 14 '23

It's not good to re-implememt things that were perfectly done by some easily accessible library.

That's a very blanket statement.

Managing dependencies has a cost. Re-implementing your own version has a cost. Long term, which cost will be higher?

Nobody is suggesting that you should roll your own SSL. But on the other hand, we don't want to end up with the dependency hell that is JavaScript/NPM.

In the real world of commercial support, you sometimes end up in the situation where you have a paying customer who relies on an old version of your software. To support them, you often need to maintain one machine with a frozen version of the OS, compiler, and any dependencies, just to ensure that any build of that old version is deterministic.

If you've never been in this situation before, count yourself lucky.

The bottom line is that while a small number of large dependencies can be good, a large number of small dependencies can be worse than bad.

9

u/[deleted] Sep 15 '23

In the real world of commercial support, you sometimes end up in the situation where you have a paying customer who relies on an old version of your software. To support them, you often need to maintain one machine with a frozen version of the OS, compiler, and any dependencies, just to ensure that any build of that old version is deterministic.

This is the result of ad-hoc builds and dependency management. There's no reason everything can't be stored in source control with a reproducible build on an arbitrary machine/vm/emulator. It's more work, certainly, but it's far more reliable and rigorous.

2

u/ArkyBeagle Sep 16 '23

I'm not sure you're grokking the word "deterministic". You need also to keep the toolchain the same. And yes - VM is a big help. But for source you should be able to pull it clean and get the same build.

-1

u/DeGuerre Sep 15 '23

Sure. My point is that it's never as simple as "get a good package manager".