liamkf / Unreal_FASTBuild

Allows UnrealEngine to be built with FASTBuild for VS2015/VS2017 and Windows 10.
MIT License
180 stars 71 forks source link

UE 4.20.1 - Getting compiler errors when bEnableCaching is turned on #30

Closed savinte closed 5 years ago

savinte commented 6 years ago

I am testing setting this up on a UE420 project. I'm pretty sure it was working before i installed the newest patch of vs2017 15.8.1.

I had modified the FASTBuild.cs file to use MSVC/14.15.26706 and fixed the other paths (due to UE changing VCEnvironment)

Now i get C1001 errors, in various files including VisualStudioCodeSourceAccessModule.cpp related to comdef.h

I've tried clearing the cache on the share.

It seems to build fine if i turn off caching.

bggangel commented 6 years ago

I second this. Can it be updated to 4.20?

jared-improbable commented 6 years ago

The solution I've gone with in my fork is to specifically disable caching for Module.VisualStudioCodeSourceAccess, basically using the same approach as Module.ProxyLODMeshReduction Adding .AllowDistribution = false and .AllowCaching = false for that particular compilation unit fixes the issue, without having to globally disable caching.

See https://developercommunity.visualstudio.com/content/problem/313306/vs2017-158-internal-compiler-error-msc1cpp-line-15-1.html for a bit more info.

yass007 commented 5 years ago

New Release should fix this issue. Let me know if it's not the case. Please note that Distribution has been tested on all platforms except XB1. We don't use caching so it wasn't tested but should work as it's using the same preprocessor path as Distribution.

BrodyHiggerson commented 5 years ago

Coming back to this - the same issue is occurring after the 4.21 update. For me, it's still in VisualStudioCodeSourceAccessModule.cpp as described. Using VS 15.9.5.

@jared-improbable, how are you specifically disabling caching per unit? I can add it to ForceLocalCompileModules like Module.ProxyLODMeshReduction as you describe. Does that also avoid caching?

EDIT: Looks like that alone doesn't fix it. Interested in your '.AllowCaching = false' fix, if you have more details.

EDIT#2: Ahh I'm a fool. I copied the module name from your post but I think it's actually "VisualStudioSourceCodeAccess", not "VisualStudioCodeSourceAccess". Have also had to add "Module.DatabaseSupport" as excluded. Have changed FASTBuild.cs thusly (such that later, I can differentiate between modules that can support caching but not distributed compilation and vice-versa, if required):

bool bSkipDistribution = false;
bool bSkipCaching = false;
foreach (var it in ForceLocalCompileModules)
{
    if (Path.GetFullPath(InputFile).Contains(it))
    {
        bSkipDistribution = true;
        bSkipCaching = true;
        break;
    }
}

if (!Action.bCanExecuteRemotely || !Action.bCanExecuteRemotelyWithSNDBS || bSkipDistribution)
{
    AddText(string.Format("\t.AllowDistribution = false\n"));
}

if (bSkipCaching)
{
    AddText(string.Format("\t.AllowCaching = false\n"));
}