[bug] Automatic rebuilding engine each time after change some C++ part of the project

How to prevent rebuilding engine again and again each time after change some C++ part of the project, or when created new EMPTY C++ project.

I am using this guide-stepper but nothing help, this f…g engine automatic recompiles each time.

  1. Be sure to compile successfully entire engine (UE4.sln) in VS2013(15)(17) (without cancelation)
  2. Open (YourProject.sln) desired for compilation C++ project in VSXXXX;
  3. Select “Engine” (in “Solution Explorer”) and delete it;
  4. Select “Programs” (in “Solution Explorer”) and delete it;
  5. Select your project (in “Solution Explorer”) and move it from “Games” to root (in “Solution Explorer”)
  6. Select “Games” (in “Solution Explorer”) and delete it
  7. File->“Save All”
  8. Exit
  9. Open YourProject.sln again in VSXXXX;
  10. Select “YourProject” (in “Solution Explorer”) and with right mouse button select “Build”

UE4 source code is from GitHub in zip file

Bug confirmed in 4.16 and 4.17, with VS2015update3 or VS2017

2 Likes

Hello Angel,

I followed the steps that you outlined using 4.17.1, and when I built the project in step 10, only the project was built for me. The Engine did not get rebuilt. Would you be able to provide some more information?

  • What Solution Configuration and Solution Platform are you building for? Are they the same in both step 1 and step 10?
  • Would it be possible to get the log for the build in step 10 where you see the Engine being rebuilt?
  • What project template did you use when you created your project?

, thank you for your short respond:

Something automatic replace “Build” with “Rebuild” in Vs2015(17)

  1. Both for Engine and Project are the same: Solution Configuration=“Development Editor”, Solution Platform=“Win64”. I always choose Build (on UE4 in Engine or MyProject in Games), never Rebuild!!!

  2. I attached log for building “temp” Project (C++ Basic Code Template) in VS2015 and log for UE4 engine

  3. Project Template: C++ Basic Code



    Here is my last step example:

  4. I Build successfully UE4.sln (Build, “Development Editor”, Win64)

  5. Then I start “UE4Editor.exe” and create C++ Basic Code Template called “temp”

  6. In VS2015u3 in “Solution Explorer” I remove all except “temp” (like is described in Guide-Stepper above)

  7. Save All

  8. Close VS2015u3

  9. Open again and Build “temp” (Build, “Development Editor”, Win64)

  10. =>Instead to compile and build only “temp” for a minute, the entire engine start to building AGAIN AND AGAIN AND AGAIN for hour(s) (including with “temp”)

Conclusion: Something is generally broken and automatic replace “Build” with “Rebuild” in VS2015u3(17)


Project “temp” log - project log from temp_Intermediate_Build_Unused


Engine UE4 log - engine log from UnrealEngine_Engine_Saved_Logs

I tried following the new steps that you provided, but still did not see the full Engine rebuild. Could you locate the BuildConfiguration.xml file and insert the following lines in between the Configuration tags:

<BuildConfiguration>
	<LogLevel>Verbose</LogLevel>
</BuildConfiguration>

If you run through the build steps again, you will get a much more detailed log that will hopefully show us why a rebuild of the Engine is being performed.

Do you see this also happen if you do not remove the Engine and Programs source code from the solution explorer window?

There is no different if I remove or not.

I repeat again the stepper 1-7 with Verbose

NO difference. Nothing work.

Engine Always REBUILD instead of BUILD, even when select Project only->Buils only temp Project.

Hours lasted. This is tremendous failure guys. Whats the point of the new versions, if older are BETTER and at least WORKING???(4.17.1 stuck on splash screen and can’r never run. I reported another bug about this but who cares- no one respond 2nd week)

After 4.13 something in UE4 is total broken.

[logs][1]
[1]: 211967-cabclogs.zip (1.8 MB)

, just for comparison, today I downloaded “UnrealEngine-4.12.zip” and compile via “Build” successfully.

Also compile via “Build” other three C++ projects- all work well. No bug found here.

The same work and with “UnrealEngine-4.12.5-release.zip”.
So the conclusions is: newer versions of UE4> 4.12.5 have this BUG (confirmed by me on 4.13.2-release, 4.14.3-release, 4.15 and 4.16)

Just my head doesn’t understand how only me have this f…g problem? Or nobody use C++ in these versions, or combination of hardware and software somehow automatic replace “Build” with “Rebuild” in VS2015(17)

1 Like

The same BUG (automatic Rebuild instead of Build command) present and in “UnrealEngine-master.zip” master branch 4.18.0-0+UE4

Some engineer from Epic messed up Built with Rebuilt in VS.
Pease, restore the working version of UE 4.12.5 or below!
All month without solution. What the f…k???

Finally I resolved this BUG in such way with tested “UnrealEngine-master.zip” master branch 4.18.0-0+UE4 (12.09.2017):

  1. Build “UE4”
  2. Replace the line “bIsEngineInstalled.Value;” with “return true;” in “UnrealBuildTool.cs”.
  3. Build “UnrealBuildTool”
  4. Done

UPDATE #1:
After compilation there maybe will occur some harmless error(s), but your project will be build without errors or warnings. If you want perfect and clean compilation you must procomment these four lines in function "static void SaveUBTMakefile(...)" in "UnrealBuildTool.cs" file:

//if (!UBTMakefile.IsValidMakefile())

// {

// throw new BuildException(“Can’t save a makefile that has invalid contents. See UBTMakefile.IsValidMakefile()”);

// }

Then build “UnrealBuildTool” Project again and you are ready, without needed to wait the whole Engine to recompile again and again each time when compile your project!






UPDATE #2:[24.9.2017]

If you will use this method, you can’t build light in Editor (“Lightning Build Failed. Swarm Failed to Kick off”):

First, you must restore the original “UnrealBuildTool.cs”, then Build “UnrealBuildTool” in VS, then Build “UnrealLightmass” in VS, then Build the light in Editor, then make above changes in “UnrealBuildTool.cs”, then Build “UnrealBuildTool” in VS, then you can change and Build your C++ project (without to automatic start Rebuilding of all Engine) and then all cycle again for new light.


SUMMARIZE:

  1. Before to compile your C++ project, you must set my changes in “UnrealBuildTool.cs” file and Build/Rebuild “UnrealBuildTool” project in VS;
  2. Before to build the light in Editor, you must remove my changes in “UnrealBuildTool.cs” file and Build/Rebuild “UnrealBuildTool” project in VS;



CONCLUSION:

I want my name for this BUG- found and resolved this little f…g s…t- more than two f…g weeks spent in researching and testing with different UE versions :):):slight_smile:

Do you still have to do this? I added 2 simple lines to assetdata.h (engine code) and the whole engine is recompiling…

I’m actually having the exact same issue. Every time I attempt to build the engine or personal project it completely rebuilds - even without touching a single file. I am on professional. I’m only going to add a few details here to Angel’s explanation above in hopes something can be done to fix it other than having to change the code above.

I only started getting this AFTER I made a shipping build using the “RunUAT BuildGraph” command. Everything before doing that worked just fine( took seconds to compile changes ). I had all sorts of issues however with getting RunUAT BuildGraph to run. First my computer only had VS 2012 and VS 2017 and it seems it needed to have VS2015 so I installed that. Here is that bug:

https://forums.unrealengine.com/development-discussion/engine-source-github/113790-installed-build-fails-trying-to-run-pdbcopy-exe

Once I got everything building a shipping version, I went back to build the editor in “development editor” and that’s when it broke. I figured I just needed to do a clean. Which I did and still same result. ( again just building without touching anything does a full rebuild )

Figured I did something stupid when attempting to get the runUAT BuildGraph script running. The thing is I only touched the installedEngineBuild.xml. I can’t imagine that has anything to do with building locally. However, I did revert it. Same thing.

In what I thought was surely going to fix it, I blow away my custom unreal engine( from github ) and resynced. Rebuilt. Then did a quick build with no changes and it fully rebuilds. - not fixed.

I decided to remove VS2015 and VS2017 and reinstalled VS2017. Same thing.

I added the verbose to my buildconfiguration.xml as mentioned above. I’ve attached it. Interestingly it now is saying…
12>UnrealBuildTool: VERBOSE: Couldn’t resolve included file “x.h”
There are a ton of header files listed.

I’m going to keep looking and hope for a none code change.

1.Clear all UE4 process
2.Build UnrealHeaderTool by Development

did you find solution?
I get this problem after using “RunUAT BuildGraph” for Linux packaging, because from Editor it’s very slow.
now Source always building no matter, that I choose only project

I’m still facing this problem in 2022 I do not know why it’s marked as solved. The UnrealBuildTool.cs file changed so much since 2017 that no code referenced in the solution exists anymore.

I think the problem is with the check to git status. You must make sure everything in the directory containing the Unreal Engine’s .git stays the exact same. I’ve spent pretty much all day waiting for the engine to recompile after I changed one small aspect of the surrounding environment, so hopefully this works.

same problem here in 2022 with 5.0.3. the engine gets recompiled everytime.

Same in 2023 :confused:

Still having this problem as well. Right clicking and clicking “Project Only → Rebuild/Build/Clean” applies that action to the engine files as well. It’s super triggering as development cannot even start!


You can live without engine modification just create file “InstalledBuild.txt” in "Engine\Build"

Maybe first you will need to build everything for all platforms and etc but even that sometimes it requres to remove file, build and return it back (like when new modules added to project, but that is not for sure)

1 Like

It didn’t work

I’ve got bunch of error like this:

Severity	Code	Description	Project	File	Line	Suppression State	Details
Error	C2953	'SelectIntPointerType': class template has already been defined	MyProj	D:\UE\UnrealEngine\Engine\Source\Runtime\Core\Public\GenericPlatform\GenericPlatform.h	13		

From my observations – rebuild is triggered by changing environment variables on Host!!!

So when I install some app into system and it adds new location in path, it triggers rebuild.

Rebuilds after some header was changed in engine is legit. But env is ridiculous.

I don’t get it, why it have to rebuild everithing if env change don’t produce new defines from build scripts?

I gota try solution with “InstalledBuild.txt”