protected virtual void DoCacheMiss(ICompiler c, DataHash hc, IEnumerable<string> args, CacheManifest m, List<string> ifiles)
{
bool good = true;
try
{
var idirs = c.GetUsedIncludeDirs(ifiles);
if (idirs.Count < 1)
{
throw new InvalidDataException(
string.Format("could not find any include folders?! [{0}]",
string.Join(" ", args)));
}
#region process includes folders
// save manifest and other things to cache
var others = c.GetPotentialIncludeFiles(idirs, ifiles);
m = new CacheManifest();
m.PotentialNewIncludes = others;
m.IncludeFiles = new Dictionary<string, string>();
m.TimeStamp = DateTime.Now.ToString("s");
m.CommonHash = hc.Hash;
#endregion
var hashes = GetHashes(ifiles);
#region check include files
foreach (var x in hashes)
{
if (x.Value.Result == DataHashResult.Ok)
{
m.IncludeFiles[x.Key] = x.Value.Hash;
}
else
{
Logging.Emit("input hash error {0} {1}", x.Key, x.Value.Result);
Logging.Miss(hc.Hash, x.Value.Result, c.WorkingDirectory, c.SingleSourceFile, x.Key);
good = false;
m.Disable = true;
break;
}
}
#endregion
}
finally
{
Unlock(CacheLockType.Read);
if (good)
{
Lock(CacheLockType.ReadWrite);
try
{
SaveOutputsLocked(m, c);
}
finally
{
Unlock(CacheLockType.ReadWrite);
}
}
}
}
}