if (!result.IsCompleted)
{
if (!Log.HasLoggedErrors)
- Log.LogError("Unknown failed occured while compiling");
+ Log.LogError("Unknown failure occured while compiling");
return false;
}
Log.LogError($"Precompiling failed for {assembly}: {ex.Message}");
return false;
}
-
+ finally
+ {
+ File.Delete(responseFilePath);
+ }
bool copied = false;
foreach (var proxyFile in proxyFiles)
{
- if (!File.Exists(proxyFile.TempFile))
- {
- Log.LogError($"Precompiling failed for {assembly}. Could not find output file {proxyFile.TempFile}");
- return false;
- }
-
copied |= proxyFile.CopyOutputFileIfChanged();
_fileWrites.Add(proxyFile.TargetFile);
}
Log.LogMessage(MessageImportance.High, $"[{count}/{_totalNumAssemblies}] {Path.GetFileName(assembly)} -> {copiedFiles}");
}
- File.Delete(responseFilePath);
compiledAssemblies.GetOrAdd(aotAssembly.ItemSpec, aotAssembly);
return true;
}
{
try
{
- if (!PrecompileLibrary(assemblyItem, monoPaths))
- return !Log.HasLoggedErrors;
- return true;
+ if (PrecompileLibrary(assemblyItem, monoPaths))
+ return true;
+ }
+ catch (LogAsErrorException laee)
+ {
+ Log.LogError($"Precompile failed for {assemblyItem}: {laee.Message}");
}
catch (Exception ex)
{
Log.LogMessage(MessageImportance.Low, $"Precompile failed for {assemblyItem}: {ex}");
else
Log.LogError($"Precompile failed for {assemblyItem}: {ex}");
-
- return false;
}
+
+ return false;
}
private void PrecompileLibraryParallel(ITaskItem assemblyItem, string? monoPaths, ParallelLoopState state)
{
try
{
- if (!PrecompileLibrary(assemblyItem, monoPaths))
- state.Break();
+ if (PrecompileLibrary(assemblyItem, monoPaths))
+ return;
+ }
+ catch (LogAsErrorException laee)
+ {
+ Log.LogError($"Precompile failed for {assemblyItem}: {laee.Message}");
}
catch (Exception ex)
{
Log.LogMessage(MessageImportance.Low, $"Precompile failed for {assemblyItem}: {ex}");
else
Log.LogError($"Precompile failed for {assemblyItem}: {ex}");
- state.Break();
}
+
+ state.Break();
}
private bool GenerateAotModulesTable(ITaskItem[] assemblies, string[]? profilers, string outputFile)
if (!_cache.Enabled)
return true;
+ if (!File.Exists(TempFile))
+ throw new LogAsErrorException($"Could not find output file {TempFile}");
+
if (!_cache.ShouldCopy(this, out string? cause))
{
_cache.Log.LogMessage(MessageImportance.Low, $"Skipping copying over {TargetFile} as the contents are unchanged");