I’ve spent the past two weeks coming up to speed on UE4 and I’m pretty sure 90% of that time has been just waiting for engine rebuilds that shouldn’t be happening.
I’ve built the engine from source with a couple minor modifications, and am working in a C++ project created with that source build. Here’s how I’d expect that to go:
- In Visual Studio, I make a change to game code (not engine code).
- I hit Build (not Rebuild).
- Game code recompiles incrementally (not from scratch).
- Engine code does not recompile at all (it was already built in order to get the editor I used to generate the .uproject, and has not been changed since then).
- I launch my source build of the engine and open my .uproject, which loads normally and is ready for editing.
Here’s what actually happens:
- In Visual Studio, I make a change to game code (not engine code).
- I hit Build (not Rebuild).
- Flip a coin. Heads: game code recompiles incrementally. Tails: entire engine source is rebuilt from scratch, ETA ~40 minutes.
- I launch my source build of the engine and open my .uproject.
- Flip a coin. Heads: the project loads normally. Tails: I get a dialog about my game assembly being out of date and asking to build it (even though I literally just did that). If I click no, the editor closes. If I click yes, the entire engine is rebuilt, ETA ~40 minutes.
This morning’s incident was the worst I’ve encountered so far. Last night I built the engine (again), built the project, loaded the project, and verified everything was working. Then I shut down and went home. Came in this morning, launched the editor, and opened the project – having made zero changes to anything in the interim – and the “out of date” dialog popped up and kicked a full engine rebuild again. Because… reasons? And then after ~30 minutes that engine rebuild failed with a non-specific error and told me to try building again from scratch, leading to another ~40 minutes of building in Visual Studio before I could even open the project at all.
How am I supposed to get anything done in this engine when it decides to rebuild itself every time I sorta-kinda look in its general direction?
I’ve pored over documentation and forums and tried a bunch of different experiments to figure out how the buildchain works and why my previous builds are getting invalidated. Things I’ve checked:
- In Visual Studio I’m hitting Build, not Rebuild. It should be doing incremental builds. Sometimes this works. Often, it doesn’t.
- I’m building the same solution configuration as before. (Naturally, changing solution configurations would cause many things to be rebuilt. I’m not doing that.)
- Nothing is ******** with the Intermediate folder. In fact, I’m often getting full engine rebuilds even when Intermediate is already populated with the up-to-date object files I just built the night before.
- I’m not making new engine code changes. (I have a small set of engine changes from early last week and no new engine changes since then.)
Are there other things that can invalidate my build artifacts? Is there some way I can debug or log this buildchain to hopefully shed some light on why it’s deciding (wrongly) that all this stuff needs to be rebuilt all the time? Is there some magic technique everyone else is using that I’m just missing?
FWIW: I’ve tried this with both VS 2015 and VS 2017 (currently using 2017) but gotten the same results. My engine build is branched from release (4.15.1) and my engine changes are minor UnrealEd interface tweaks that have nothing to do with building. And I’m on Windows 10.