Bug in C++ dependency system

This seems to happen to me fairly frequently (I’m always tweaking code while compiling)

  1. Run editor for C++ project

  2. Start a Compile

  3. Change a line of code save file THEN cancel compile from dialog box in corner of screen

  4. Start a build

  5. Be told that everything is up to date

  6. Your change is not in game, you cannot set breakpoints as code is not up to date

Hi ,

I’ve assigned a member of support team to look into this for you, and they’ll post here if they have any questions. Thanks for report!

Hey - I would expect you not to recommend making changes to code during compiles however with long compile times (especially when there are errors?) this is also something I expect to find people doing all time and current behavior is definitely a bug.

While I wouldn’t expect coherent code to be created if you are compiling currently you have to make an extra edit to get dependency checked to allow a build.

This means that file timestamps are being recorded after edits made while compiler was in progress, but before a proper build is created. These timestamps should be either reverted when build is cancelled or cached at a later point in process.

So - your recommendation is a good one, especially for novice programmers, but there is a bug that should be fixed :slight_smile:

Why should it be fixed? Sometimes results might be quite subtle and people will lose time testing changes that have not actually taken. Sure you should always check output logs etc but humans are humans, and time is time and we don’t get it back when we waste it!

Hey -

We don’t recommend making changes to code while a compile is in process. Instead it is better to cancel compile and then make necessary changes before compiling again. Another option is to use Rebuild option in Visual Studio rather than Build. This will build all files for projects rather than only files that were changed.


I’m not arguing about workflow - just about validity of a bug :slight_smile:

second build should be started in editor.

  1. Start a build - By pressing compile in editor

Its not 100% - I just tried reproducing it a bunch of times - it may depend on time during compile at which you make edit, or at which you cancel compile if you cancel it, but I’ve hit it quite a few times, hence reporting it.

It’s also long standing, been around as long as I can remember using Ue4.

It’s quite normal in my workflow to be compiling a change to test (either test compilation state or test functionality) while continuing to make changes to code. Stopping coding to wait for compiles is definitely inefficient especially when you are “in zone”.

Unfortunately this process occasionally hits this bug in system :slight_smile:

It sounds like you are pressing compile button in editor and then changing your code before canceling compile. After canceling editor compile you then restart build through Visual Studio, is this correct? When I tried this method it still updated properly after building in Visual Studio. Additionally if changes to code need to be made, there is no difference in time to stop compile first and then change code and is a safer workflow.

I’ve submitted a bug report to investigate code changes not being registered after canceling a compile (UE-19465).