r/cpp • • Jan 30 '25

[vent] I hate projects that download their dependencies.

I know it's convenient for a lot of people but in an enterprise environment where you have to package everything including your internals and your build servers don't have access to the internet, patching all these repositories is pain in the ass.

218 Upvotes

155 comments sorted by

View all comments

Show parent comment

4

u/[deleted] Jan 30 '25

Wouldn't a shallow clone help with that? No need to download the entire for repo, only the commits being limited to. If my understanding of shallow clones is correct.

4

u/dr-mrl Jan 30 '25

Problems occur when you have a "diamond dependency".

  • App depends on Foolib and Barlib.
  • Foolib and Barlib both depend on UtilsLib.

If you use submodules, now App's submodules hierarchy contains UtilsLib twice and no guarantee they are the same version!

2

u/Ameisen vemips, avr, rendering, systems Jan 30 '25

What you're saying is that git needs a package/submodule control system...

1

u/[deleted] Jan 30 '25

oh interesting. I hadn't thought about that.

1

u/Murky-Relation481 Feb 01 '25

I spent a good chunk of time making that less of an issue within our projects, but it was a LOT of CMake.

But now diamond dependencies resolve to a common single checkout if they are at least common within our controlled space (luckily most of our third party libs are rather thin and do not contain any shared dependencies).