Download

Issue with repeated dependency downloads using GitDependencies.exe?

Hello,

I’m new to working with the UE4 source code. I have forked the repository, cloned my fork, and added Epic’s source as a remote.

However, I seem to be encountering something that I found nobody else mentioning. When I checkout a certain release tag of the repository (e.g. git checkout 4.7.6-release), the checkout hook downloads the required dependencies (as expected). If I checkout a different branch, it will download new dependencies (as expected?), but then, when I immediately re-checkout the previous branch (e.g. 4.7.6-release), it re-downloads ALL the dependencies again (all 3GB). The only branch that seems to use cached dependencies is the master branch. Every other branch re-downloads the dependencies, every single time.

This is making switching between branches an extremely slow process (not to mention is going to max out my ISP bandwidth, at 3GB per checkout).

I need to switch back and forth between various release versions of the engine source code, repeatedly, in a given day.

Am I doing something wrong? Is this the expected behaviour? I was under the impression these dependencies should be getting cached so I’m surprised that it re-downloaded the entire set of files again when I re-checked out a branch other than master.

Thanks,
Steve

So, I found a workaround to my own problem. However, I’m still curious to know if the behaviour I was experiencing was the “intended” behaviour of the dependency update workflow.

That said, for those who are interested, here is my workaround:

I edited the Git post-checkout and post-merge hooks to take advantage of the --cache=$PATH argument to GitDependencies.exe (which, as far as I can tell, became available with the 4.8.0 release).

In the hook script, I query the current branch/tag that is being checked out/merged-into, and I use this to create a cache that is local to that version (e.g. P:/cachedGitDependencies/4.8.0-release/". This way, every subsequent time I checkout that same branch, the cache is still there, and it loads all dependencies from this cache. 0% of the dependencies have to be re-downloaded. This is much faster, and also helps with my internet bandwidth.

This isn’t a perfect solution, but it does at least help quite a bit with rapidly checking out different version releases (which is what I need to do).

Again, I’m not sure that I should have to do this… but it gives me the workflow that I would like, so I’m happy with this workaround.

Cheers,
Steve

I simply checkout different branch into different folder and build from there. Also I don’t use the provided git hooks, and only run GitDependencies manually when there’s dependency changes in commit messages.

Hi Nate,

I really appreciate the input, thank you!

Your approach is a lot easier to manage than the way I was approaching this. I redesigned my project to use each version-branch in it’s own folder, and it made things a lot easier! Not only does it solve the dependencies problem, but it also reduces build time for each version of the engine, because the intermediate files aren’t blown away each time, like they are when switching branches. Definitely a smarter way to go, thanks :slight_smile:

Steve

I wished the tool would cache the downloads by now. And be able to create a bundle to archive a specific version without doing that manually. If the service goes down this will be a problem.

Because once checkout 4.7, GitDependencies.exe is replaced with a version without cache function. A quick fix is to keep latest GitDependencies.exe outside GIT folder.

  1. git checkout 4.9
  2. cp Engine/Binaries/DotNET/GitDependencies.exe …/
  3. #edit git/hooks/post-checkout & post-merge:
    cp -f …/GitDependencies.exe Engine/Binaries/DotNET/
    Engine/Binaries/DotNET/GitDependencies.exe

Now git checkout 4.7 or 4.6 works with cache! Very useful for NVPhysX branch because they still on 4.7