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 the file THEN cancel the compile from the dialog box in the corner of the screen

  4. Start a build

  5. Be told that everything is up to date

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

Hi theonecalledtom,

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

Hey Doug - I would expect you not to recommend making changes to code during compiles however with the long compile times (especially when there are errors?) this is also something I expect to find people doing all the time and the 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 the dependency checked to allow a build.

This means that file timestamps are being recorded after the edits made while the compiler was in progress, but before a proper build is created. These timestamps should be either reverted when the build is cancelled or cached at a later point in the 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 the results might be quite subtle and people will lose time testing changes that have not actually taken. Sure you should always check the output logs etc but humans are humans, and time is time and we don’t get it back when we waste it!

Hey theonecalledtom-

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


Doug Wilson

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

The second build should be started in the editor.

  1. Start a build - By pressing compile in the editor

Its not 100% - I just tried reproducing it a bunch of times - it may depend on the time during compile at which you make the edit, or at which you cancel the 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 the zone”.

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

It sounds like you are pressing the compile button in the editor and then changing your code before canceling the compile. After canceling the editor compile you then restart the 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 the code need to be made, there is no difference in time to stop the compile first and then change the code and is a safer workflow.

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