# Git is breaking compile?

**URL:** <https://forums.unrealengine.com/t/git-is-breaking-compile/421820>\
**Category:** Platform & Builds\
**Tags:** unreal-engine, compile, git, question\
**Created:** [April 4, 2018, 4:12pm UTC](https://forums.unrealengine.com/t/git-is-breaking-compile/421820 "2018-04-04T16:12:23Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![JonTronne](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@JonTronne](https://forums.unrealengine.com/u/JonTronne)\
**Post date:** [April 4, 2018, 4:12pm UTC](https://forums.unrealengine.com/t/git-is-breaking-compile/421820/1 "2018-04-04T16:12:23Z")

</div>

There is something going on with git and the build process. If I have an untouched local repo, it will compile, but if I make a single change to a file (adding a comment line), it will no longer compile and gives me nonsense errors. If I commit the change I made, then do a full rebuild it will compile again successfully.

I assume it has something to do with the “Using ‘git status’ to determine working set for adaptive non-unity build.” line. If I copy the project to a separate folder without git, that line doesn’t appear and I do not have these problems.

Here’s the build log that happens when trying to launch the .uproject.

What is going on and how do I disable this? (ideally without having to disable Unity Build)

Also, I have these lines in my Target.cs file:

```
bUseUnityBuild = false;
bUsePCHFiles = false;
bUseAdaptiveUnityBuild = false;

```

Why is it still doing unity build stuff with unity build disabled?

---

<div class="post-metadata">

**Author:** ![Shadowriver](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shadowriver](https://forums.unrealengine.com/u/Shadowriver)\
**Post date:** [April 4, 2018, 6:24pm UTC](https://forums.unrealengine.com/t/git-is-breaking-compile/421820/2 "2018-04-04T18:24:30Z")

</div>

Git should not effect compile process, or else source files are placed wrongly by the git. Open VS project (sln file) and do rebuild the solution, if that does not work delete intermediate directory from project directory and regenerate VS project files (as some of files are in that deleted directory and need to be regenerated)

```
e:\files\murderminersx project\mmx git\mmx\source\mmx\mapmaker\MapObjectType.h(5): error C2065: 'BlueprintType': undeclared identifier

```

Sounds like USTRUCT or UCLASS macros deceleration are missing or misspelled, check if includes are correct

---

<div class="post-metadata">

**Author:** ![JonTronne](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@JonTronne](https://forums.unrealengine.com/u/JonTronne)\
**Post date:** [April 4, 2018, 6:46pm UTC](https://forums.unrealengine.com/t/git-is-breaking-compile/421820/3 "2018-04-04T18:46:51Z")

</div>

Thanks, I’ve tried doing a full rebuild, but no effect.

> Git should not effect compile process  
> It must effect it in some way, as indicated by the line, “Using ‘git status’ to determine working set for adaptive non-unity build”, which displays when starting the compile. This line does not appear when I copy the project to a non-git repo folder, and there are no compile errors either.

---

<div class="post-metadata">

**Author:** ![Shadowriver](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shadowriver](https://forums.unrealengine.com/u/Shadowriver)\
**Post date:** [April 6, 2018, 2:50am UTC](https://forums.unrealengine.com/t/git-is-breaking-compile/421820/4 "2018-04-06T02:50:50Z")

</div>

But errors does not make sense, it suggest it has something to do with U macros and UHT generated code. Do you are aware what is unity build? When unity build is made you should only see cpp file with module name and x of x so you should see if there any effect to your configuration or not.

---

<div class="post-metadata">

**Author:** ![Yasja\_de\_Miranda](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Yasja\_de\_Miranda](https://forums.unrealengine.com/u/Yasja_de_Miranda)\
**Post date:** [April 15, 2018, 9:49am UTC](https://forums.unrealengine.com/t/git-is-breaking-compile/421820/5 "2018-04-15T09:49:09Z")

</div>

Hi, I had a similar issue and it turned out that I deleted the ProjectEditor.Target.cs file. I missed this because there was a wrongly named \*.Target.cs file instead, which was omitted by UBT. This might be the cause for your problem.

What I did to solve this is to create a new project and compare the contents of the Source folder with my actual project.

I hope this helps.

---

<div class="post-metadata">

**Author:** ![JonTronne](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@JonTronne](https://forums.unrealengine.com/u/JonTronne)\
**Post date:** [May 28, 2018, 5:46pm UTC](https://forums.unrealengine.com/t/git-is-breaking-compile/421820/6 "2018-05-28T17:46:57Z")

</div>

Adding this to my BuildConfiguration.xml disables the “Using ‘git status’ to determine working set for adaptive non-unity build.” process and fixes the problem for me. Found in [this post](https://answers.unrealengine.com/questions/736545/waiting-for-git-status-command-to-complete-making.html?sort=oldest).

```
<SourceFileWorkingSet> 
         <Provider>None</Provider> 
         <RepositoryPath></RepositoryPath> 
         <GitPath></GitPath> 
     </SourceFileWorkingSet>

```

I think the adaptive non-unity build may have problems. If there was an error in my code, it would identify an error like “error C2065: ‘BlueprintType’: undeclared identifier”, instead of the actual error. Once I committed the changes and did a full rebuild, however, it would then identify the actual error. In order to get a successful compile, I would have to fix the error, commit the changes, and do a full rebuild.

---

<div class="post-metadata">

**Author:** ![EvoPulseGaming](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EvoPulseGaming](https://forums.unrealengine.com/u/EvoPulseGaming)\
**Post date:** [June 12, 2018, 6:37am UTC](https://forums.unrealengine.com/t/git-is-breaking-compile/421820/7 "2018-06-12T06:37:55Z")

</div>

I’m sorry but this is a git status issue. deleting intermediate ect ect because you made a change to code is not acceptable ever.

Now i’d like to note, this does not always happen, but in particular I am messing with compute shaders and there is a file I am working in, that has a lot of macros, and if I make a single change it cries.

The work around is to commit, and then recompile (which then no longer excludes the file from unity mode)

This issue, is when it uses git status to determine if a file should be in unity mode, it gets excluded from the lumped up file, when dealing with macros this can cause “undefined” errors

---

<div class="post-metadata">

**Author:** ![makai](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@makai](https://forums.unrealengine.com/u/makai)\
**Post date:** [April 29, 2019, 4:13pm UTC](https://forums.unrealengine.com/t/git-is-breaking-compile/421820/8 "2019-04-29T16:13:10Z")

</div>

For those who don’t know where to find BuildConfiguration.xml like me:  
According to [Build Configuration for Unreal Engine | Unreal Engine 5.1 Documentation](https://docs.unrealengine.com/en-us/Programming/BuildTools/UnrealBuildTool/BuildConfiguration)  
you can find the BuildConfiguration.xml here  
For those who don’t know where to find BuildConfiguration.xml like me:  
According to [Build Configuration for Unreal Engine | Unreal Engine 5.1 Documentation](https://docs.unrealengine.com/en-us/Programming/BuildTools/UnrealBuildTool/BuildConfiguration)  
you can find the BuildConfiguration.xml here

For those who don’t know where to find BuildConfiguration.xml like me:  
According to [Build Configuration for Unreal Engine | Unreal Engine 5.1 Documentation](https://docs.unrealengine.com/en-us/Programming/BuildTools/UnrealBuildTool/BuildConfiguration)  
you can find the BuildConfiguration.xml here:

- Engine/Saved/UnrealBuildTool/BuildConfiguration.xml
- User Folder/AppData/Roaming/Unreal Engine/UnrealBuildTool/BuildConfiguration.xml
- My Documents/Unreal Engine/UnrealBuildTool/BuildConfiguration.xml

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_c91def4e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_c91def4e](https://forums.unrealengine.com/u/anonymous_user_c91def4e)\
**Post date:** [July 9, 2019, 6:57pm UTC](https://forums.unrealengine.com/t/git-is-breaking-compile/421820/9 "2019-07-09T18:57:49Z")

</div>

Why on earth would a file that effects the build be in a user folder? Thats the most idiotic thing I’ve ever seen. Doesn’t epic use Version Control? have multiple employees compiling code? Am I to believe they all have a different BuildConfiguration they are using? What do they do synch to a file in perforce, then manually make changes to the local file? I wish Sweeny would start writing code again. Until he gets ■■■■■■ at all the stupid ■■■■ we are just going to drown in it.

---

<div class="post-metadata">

**Author:** ![Kakushi\_52](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kakushi\_52](https://forums.unrealengine.com/u/Kakushi_52)\
**Post date:** [March 3, 2021, 3:18pm UTC](https://forums.unrealengine.com/t/git-is-breaking-compile/421820/10 "2021-03-03T15:18:20Z")

</div>

I got exactly the same problem today. There was no code error, but whenever I modify a particular .cpp file, the log

```
[Adaptive unity build] Excluded from XXX unity file: YYY.cpp

```

appeared, and the following error occurred.

```
C1189 error: "No Target Architecture" C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um\winnt.h 173

```

I am using Git for the source control, so I tried removing .git folder, then the build succeeded. After the success, moving back the .git folder did not cause any build error.

So, as some people guess, I also guess Git sometimes affect the issue. I think it might be an issue of Unreal Build Tool rather than Git.

However, I have no idea when this problem occurs. In my case, it suddenly appeared.  
As JonTronne says, adding a single space to the code caused this problem.

Maybe a rare Unreal Build Tool’s bug??

---

<div class="post-metadata">

**Author:** ![JesseaChen](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@JesseaChen](https://forums.unrealengine.com/u/JesseaChen)\
**Post date:** [April 13, 2022, 9:30am UTC](https://forums.unrealengine.com/t/git-is-breaking-compile/421820/12 "2022-04-13T09:30:50Z")

</div>

the same with u, just removing .git folder, then the build succeeded. After the success, moving back the .git folder build error repeat appeared.

---

<div class="post-metadata">

**Author:** ![Kakushi\_52](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kakushi\_52](https://forums.unrealengine.com/u/Kakushi_52)\
**Post date:** [April 13, 2022, 2:14pm UTC](https://forums.unrealengine.com/t/git-is-breaking-compile/421820/13 "2022-04-13T14:14:49Z")

</div>

Sorry for my inadequate explanation. After moving back the .git folder, I think you have to commit the current status before trying another build.
