Git is breaking compile?

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?

1 Like

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

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.

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.

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.

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.

<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.

2 Likes

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

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
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
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
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

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.

1 Like

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??

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

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