Hello, I want to post process my assemblies, before Burst compiler kicks in, so to make some of my code Burst compatible.
I’ve subscribed to the CompilationPipeline.compilationFinished += CompilationFinished;
,
then I got this handler:
var dlls = CompilationPipeline.GetAssemblies().Select(x => x.outputPath).ToArray();
if (dlls.Length == 0)
return;
var root = CompilationPipeline.GetPrecompiledAssemblyPaths(CompilationPipeline.PrecompiledAssemblySources
.UserAssembly);
dlls = dlls.Select(x => Path.Combine(Directory.GetCurrentDirectory(), x)).ToArray();
dlls = dlls.Union(root).ToArray();
foreach (string dll in dlls)
{
Debug.Log($"DLL: {dll}");
}
Debug.Log("?????");
HandleAssemblyReload(false, false, dlls, Path.GetDirectoryName(dlls[0]), null, null);
Debug.Log("!!!!!");
All dlls are printed fine, but Burst compiler error somehow appears in between ??? and !!! Debug.Logs. Here’s the debug log.
** MORE DLL LINES HERE OMITED ***
DLL: C:/Users/.../Library/PackageCache/com.unity.burst@1.8.17/Unity.Burst.CodeGen/Unity.Burst.Cecil.Rocks.dll
?????
C:\Users\...\Assets\UserCode\CsWrappers\EvhWrapper.cs(41,13): Burst error BC1016: The managed function `Meetem.EvhWrapper.get_EventHandle(Meetem.EvhWrapper* this)` is not supported
!!!!!
The error Burst is throwing should be non-existent because my post processing fixing it. But for some reason Burst compiling is executed in-between my post processing code?
How do I guarantee that my IL post processing is executed before Burst, and other question how do I guarantee that my IL post processing is executed after Burst, e.g. how do I control the order of post processing?
UPD: Ok, it seems like Burst compiling is running asynchrnously and doesn’t respect the post processors. E.g. can run while CompilationPipeline.compilationFinished
handlers are running.
Don’t know if it’s by-design.